You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-20Lines changed: 9 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,26 +132,15 @@ default-features = false
132
132
Using static mechanisms makes your program faster. See my benchmark result below (Intel i7-6700HQ, ran on 2018/11/14):
133
133
134
134
```text
135
-
include_str/include_str_no_static
136
-
time: [8.3773 us 8.4061 us 8.4361 us]
137
-
include_str/include_str_native_static
138
-
time: [965.65 ns 969.47 ns 973.04 ns]
139
-
include_str/include_str_lazy_static
140
-
time: [955.93 ns 958.78 ns 961.88 ns]
141
-
142
-
include_bytes/include_bytes_no_static
143
-
time: [7.7806 us 7.8056 us 7.8318 us]
144
-
include_bytes/include_bytes_native_static
145
-
time: [418.43 ns 420.12 ns 421.83 ns]
146
-
include_bytes/include_bytes_lazy_static
147
-
time: [413.43 ns 415.14 ns 417.37 ns]
148
-
149
-
include_array/include_array_no_static
150
-
time: [30.125 us 30.285 us 30.445 us]
151
-
include_array/include_array_native_static
152
-
time: [38.510 ns 38.640 ns 38.786 ns]
153
-
include_array/include_array_lazy_static
154
-
time: [39.713 ns 39.863 ns 40.019 ns]
135
+
test include_array_lazy_static ... bench: 43 ns/iter (+/- 3)
136
+
test include_array_native_static ... bench: 46 ns/iter (+/- 4)
137
+
test include_array_no_static ... bench: 29,714 ns/iter (+/- 1,156)
138
+
test include_bytes_lazy_static ... bench: 382 ns/iter (+/- 63)
139
+
test include_bytes_native_static ... bench: 380 ns/iter (+/- 30)
140
+
test include_bytes_no_static ... bench: 9,076 ns/iter (+/- 1,224)
141
+
test include_str_lazy_static ... bench: 932 ns/iter (+/- 103)
142
+
test include_str_native_static ... bench: 937 ns/iter (+/- 25)
143
+
test include_str_no_static ... bench: 10,135 ns/iter (+/- 1,634)
155
144
```
156
145
157
146
When using the **release** profile, the performance of `lazy_static_include_*` is very close to `include_*`. That means you don't need to worry about the overhead, but just enjoy the faster compilation time.
0 commit comments