on master help sign in
Add native `#[bench]`es for quickly assessing perf impact of some change
commit7967ecad5b3e9a1ea58a62bbaaebb19be7edc052 authorNick Fitzgerald <fitzgen@gmail.com> dateWed 20 Mar 2019, 15:04 (8 years ago) parent73ddeb8
7 files changed+790−255
Cargo.lock+418−114 Cargo.toml+18 benches/benches.rs+130 src/change_list.rs+59−37 src/events.rs+103−84 src/lib.rs+14 src/vdom.rs+48−20
Cargo.lock+418−114
@@ -1,17 +1,25 @@
11[[package]]
22name = "aho-corasick"
3−version = "0.6.10"
3+version = "0.7.3"
44source = "registry+https://github.com/rust-lang/crates.io-index"
55dependencies = [
66 "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
77]
88
9+[[package]]
10+name = "arrayvec"
11+version = "0.4.10"
12+source = "registry+https://github.com/rust-lang/crates.io-index"
13+dependencies = [
14+ "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
15+]
16+
917[[package]]
1018name = "atty"
1119version = "0.2.11"
1220source = "registry+https://github.com/rust-lang/crates.io-index"
1321dependencies = [
14− "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
22+ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
1523 "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
1624 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
1725]
@@ -29,7 +37,7 @@ dependencies = [
2937 "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
3038 "backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
3139 "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
32− "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
40+ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
3341 "rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
3442 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
3543]
@@ -39,10 +47,15 @@ name = "backtrace-sys"
3947version = "0.1.28"
4048source = "registry+https://github.com/rust-lang/crates.io-index"
4149dependencies = [
42− "cc 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)",
43− "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
50+ "cc 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)",
51+ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
4452]
4553
54+[[package]]
55+name = "bitflags"
56+version = "1.0.4"
57+source = "registry+https://github.com/rust-lang/crates.io-index"
58+
4659[[package]]
4760name = "bumpalo"
4861version = "2.3.0"
@@ -53,9 +66,14 @@ name = "byteorder"
5366version = "1.3.1"
5467source = "registry+https://github.com/rust-lang/crates.io-index"
5568
69+[[package]]
70+name = "cast"
71+version = "0.2.2"
72+source = "registry+https://github.com/rust-lang/crates.io-index"
73+
5674[[package]]
5775name = "cc"
58−version = "1.0.31"
76+version = "1.0.32"
5977source = "registry+https://github.com/rust-lang/crates.io-index"
6078
6179[[package]]
@@ -63,13 +81,31 @@ name = "cfg-if"
6381version = "0.1.7"
6482source = "registry+https://github.com/rust-lang/crates.io-index"
6583
84+[[package]]
85+name = "clap"
86+version = "2.32.0"
87+source = "registry+https://github.com/rust-lang/crates.io-index"
88+dependencies = [
89+ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
90+ "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
91+ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
92+]
93+
94+[[package]]
95+name = "cloudabi"
96+version = "0.0.3"
97+source = "registry+https://github.com/rust-lang/crates.io-index"
98+dependencies = [
99+ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
100+]
101+
66102[[package]]
67103name = "console_error_panic_hook"
68104version = "0.1.6"
69105source = "registry+https://github.com/rust-lang/crates.io-index"
70106dependencies = [
71107 "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
72− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
108+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
73109]
74110
75111[[package]]
@@ -78,7 +114,89 @@ version = "0.1.2"
78114source = "registry+https://github.com/rust-lang/crates.io-index"
79115dependencies = [
80116 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
81− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
117+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
118+]
119+
120+[[package]]
121+name = "criterion"
122+version = "0.2.10"
123+source = "registry+https://github.com/rust-lang/crates.io-index"
124+dependencies = [
125+ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
126+ "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
127+ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
128+ "criterion-plot 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
129+ "csv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
130+ "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
131+ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
132+ "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
133+ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
134+ "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
135+ "rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
136+ "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
137+ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
138+ "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
139+ "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
140+ "tinytemplate 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
141+ "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
142+]
143+
144+[[package]]
145+name = "criterion-plot"
146+version = "0.3.0"
147+source = "registry+https://github.com/rust-lang/crates.io-index"
148+dependencies = [
149+ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
150+ "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
151+ "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
152+]
153+
154+[[package]]
155+name = "crossbeam-deque"
156+version = "0.2.0"
157+source = "registry+https://github.com/rust-lang/crates.io-index"
158+dependencies = [
159+ "crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
160+ "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
161+]
162+
163+[[package]]
164+name = "crossbeam-epoch"
165+version = "0.3.1"
166+source = "registry+https://github.com/rust-lang/crates.io-index"
167+dependencies = [
168+ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
169+ "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
170+ "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
171+ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
172+ "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
173+ "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
174+ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
175+]
176+
177+[[package]]
178+name = "crossbeam-utils"
179+version = "0.2.2"
180+source = "registry+https://github.com/rust-lang/crates.io-index"
181+dependencies = [
182+ "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
183+]
184+
185+[[package]]
186+name = "csv"
187+version = "1.0.5"
188+source = "registry+https://github.com/rust-lang/crates.io-index"
189+dependencies = [
190+ "csv-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
191+ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
192+]
193+
194+[[package]]
195+name = "csv-core"
196+version = "0.1.5"
197+source = "registry+https://github.com/rust-lang/crates.io-index"
198+dependencies = [
199+ "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
82200]
83201
84202[[package]]
@@ -88,15 +206,16 @@ dependencies = [
88206 "bumpalo 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
89207 "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
90208 "console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
209+ "criterion 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
91210 "dodrio-js-api 0.1.0",
92211 "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
93212 "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
94− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
213+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
95214 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
96− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
97− "wasm-bindgen-futures 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
98− "wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
99− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
215+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
216+ "wasm-bindgen-futures 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
217+ "wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
218+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
100219]
101220
102221[[package]]
@@ -107,9 +226,9 @@ dependencies = [
107226 "console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
108227 "dodrio 0.1.0",
109228 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
110− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
111− "wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
112− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
229+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
230+ "wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
231+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
113232]
114233
115234[[package]]
@@ -119,11 +238,11 @@ dependencies = [
119238 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
120239 "dodrio 0.1.0",
121240 "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
122− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
123− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
124− "wasm-bindgen-futures 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
125− "wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
126− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
241+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
242+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
243+ "wasm-bindgen-futures 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
244+ "wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
245+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
127246]
128247
129248[[package]]
@@ -132,9 +251,9 @@ version = "0.1.0"
132251dependencies = [
133252 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
134253 "dodrio 0.1.0",
135− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
136− "wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
137− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
254+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
255+ "wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
256+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
138257]
139258
140259[[package]]
@@ -143,9 +262,9 @@ version = "0.1.0"
143262dependencies = [
144263 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
145264 "dodrio 0.1.0",
146− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
147− "wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
148− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
265+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
266+ "wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
267+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
149268]
150269
151270[[package]]
@@ -154,10 +273,10 @@ version = "0.1.0"
154273dependencies = [
155274 "dodrio 0.1.0",
156275 "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
157− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
158− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
159− "wasm-bindgen-futures 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
160− "wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
276+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
277+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
278+ "wasm-bindgen-futures 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
279+ "wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
161280]
162281
163282[[package]]
@@ -167,9 +286,9 @@ dependencies = [
167286 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
168287 "dodrio 0.1.0",
169288 "dodrio-js-api 0.1.0",
170− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
171− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
172− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
289+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
290+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
291+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
173292]
174293
175294[[package]]
@@ -181,12 +300,12 @@ dependencies = [
181300 "console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
182301 "dodrio 0.1.0",
183302 "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
184− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
303+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
185304 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
186− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
187− "wasm-bindgen-futures 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
188− "wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
189− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
305+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
306+ "wasm-bindgen-futures 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
307+ "wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
308+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
190309]
191310
192311[[package]]
@@ -196,11 +315,11 @@ dependencies = [
196315 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
197316 "dodrio 0.1.0",
198317 "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
199− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
200− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
201− "wasm-bindgen-futures 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
202− "wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
203− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
318+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
319+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
320+ "wasm-bindgen-futures 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
321+ "wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
322+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
204323]
205324
206325[[package]]
@@ -212,16 +331,21 @@ dependencies = [
212331 "console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
213332 "dodrio 0.1.0",
214333 "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
215− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
334+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
216335 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
217336 "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
218337 "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
219− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
220− "wasm-bindgen-futures 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
221− "wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
222− "web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
338+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
339+ "wasm-bindgen-futures 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
340+ "wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
341+ "web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
223342]
224343
344+[[package]]
345+name = "either"
346+version = "1.5.1"
347+source = "registry+https://github.com/rust-lang/crates.io-index"
348+
225349[[package]]
226350name = "env_logger"
227351version = "0.6.1"
@@ -230,7 +354,7 @@ dependencies = [
230354 "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
231355 "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
232356 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
233− "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
357+ "regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
234358 "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
235359]
236360
@@ -250,10 +374,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
250374dependencies = [
251375 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
252376 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
253− "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)",
377+ "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)",
254378 "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
255379]
256380
381+[[package]]
382+name = "fuchsia-cprng"
383+version = "0.1.1"
384+source = "registry+https://github.com/rust-lang/crates.io-index"
385+
257386[[package]]
258387name = "futures"
259388version = "0.1.26"
@@ -283,6 +412,14 @@ dependencies = [
283412 "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
284413]
285414
415+[[package]]
416+name = "itertools"
417+version = "0.8.0"
418+source = "registry+https://github.com/rust-lang/crates.io-index"
419+dependencies = [
420+ "either 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
421+]
422+
286423[[package]]
287424name = "itoa"
288425version = "0.4.3"
@@ -290,10 +427,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
290427
291428[[package]]
292429name = "js-sys"
293−version = "0.3.16"
430+version = "0.3.17"
294431source = "registry+https://github.com/rust-lang/crates.io-index"
295432dependencies = [
296− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
433+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
297434]
298435
299436[[package]]
@@ -303,7 +440,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
303440
304441[[package]]
305442name = "libc"
306−version = "0.2.50"
443+version = "0.2.51"
307444source = "registry+https://github.com/rust-lang/crates.io-index"
308445
309446[[package]]
@@ -318,16 +455,42 @@ dependencies = [
318455name = "memchr"
319456version = "2.2.0"
320457source = "registry+https://github.com/rust-lang/crates.io-index"
458+dependencies = [
459+ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
460+]
461+
462+[[package]]
463+name = "memoffset"
464+version = "0.2.1"
465+source = "registry+https://github.com/rust-lang/crates.io-index"
466+
467+[[package]]
468+name = "nodrop"
469+version = "0.1.13"
470+source = "registry+https://github.com/rust-lang/crates.io-index"
321471
322472[[package]]
323473name = "nom"
324−version = "4.2.2"
474+version = "4.2.3"
325475source = "registry+https://github.com/rust-lang/crates.io-index"
326476dependencies = [
327477 "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
328478 "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
329479]
330480
481+[[package]]
482+name = "num-traits"
483+version = "0.2.6"
484+source = "registry+https://github.com/rust-lang/crates.io-index"
485+
486+[[package]]
487+name = "num_cpus"
488+version = "1.10.0"
489+source = "registry+https://github.com/rust-lang/crates.io-index"
490+dependencies = [
491+ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
492+]
493+
331494[[package]]
332495name = "proc-macro2"
333496version = "0.4.27"
@@ -349,9 +512,73 @@ dependencies = [
349512 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
350513]
351514
515+[[package]]
516+name = "rand_core"
517+version = "0.3.1"
518+source = "registry+https://github.com/rust-lang/crates.io-index"
519+dependencies = [
520+ "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
521+]
522+
523+[[package]]
524+name = "rand_core"
525+version = "0.4.0"
526+source = "registry+https://github.com/rust-lang/crates.io-index"
527+
528+[[package]]
529+name = "rand_os"
530+version = "0.1.3"
531+source = "registry+https://github.com/rust-lang/crates.io-index"
532+dependencies = [
533+ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
534+ "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
535+ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
536+ "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
537+ "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
538+ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
539+]
540+
541+[[package]]
542+name = "rand_xoshiro"
543+version = "0.1.0"
544+source = "registry+https://github.com/rust-lang/crates.io-index"
545+dependencies = [
546+ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
547+ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
548+]
549+
550+[[package]]
551+name = "rayon"
552+version = "1.0.3"
553+source = "registry+https://github.com/rust-lang/crates.io-index"
554+dependencies = [
555+ "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
556+ "either 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
557+ "rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
558+]
559+
560+[[package]]
561+name = "rayon-core"
562+version = "1.4.1"
563+source = "registry+https://github.com/rust-lang/crates.io-index"
564+dependencies = [
565+ "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
566+ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
567+ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
568+ "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
569+]
570+
571+[[package]]
572+name = "rdrand"
573+version = "0.4.0"
574+source = "registry+https://github.com/rust-lang/crates.io-index"
575+dependencies = [
576+ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
577+]
578+
352579[[package]]
353580name = "redox_syscall"
354−version = "0.1.51"
581+version = "0.1.52"
355582source = "registry+https://github.com/rust-lang/crates.io-index"
356583
357584[[package]]
@@ -359,24 +586,24 @@ name = "redox_termios"
359586version = "0.1.1"
360587source = "registry+https://github.com/rust-lang/crates.io-index"
361588dependencies = [
362− "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)",
589+ "redox_syscall 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)",
363590]
364591
365592[[package]]
366593name = "regex"
367−version = "1.1.2"
594+version = "1.1.5"
368595source = "registry+https://github.com/rust-lang/crates.io-index"
369596dependencies = [
370− "aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
597+ "aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
371598 "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
372− "regex-syntax 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
599+ "regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
373600 "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
374601 "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
375602]
376603
377604[[package]]
378605name = "regex-syntax"
379−version = "0.6.5"
606+version = "0.6.6"
380607source = "registry+https://github.com/rust-lang/crates.io-index"
381608dependencies = [
382609 "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -392,11 +619,24 @@ name = "ryu"
392619version = "0.2.7"
393620source = "registry+https://github.com/rust-lang/crates.io-index"
394621
622+[[package]]
623+name = "same-file"
624+version = "1.0.4"
625+source = "registry+https://github.com/rust-lang/crates.io-index"
626+dependencies = [
627+ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
628+]
629+
395630[[package]]
396631name = "scoped-tls"
397632version = "1.0.0"
398633source = "registry+https://github.com/rust-lang/crates.io-index"
399634
635+[[package]]
636+name = "scopeguard"
637+version = "0.3.3"
638+source = "registry+https://github.com/rust-lang/crates.io-index"
639+
400640[[package]]
401641name = "serde"
402642version = "1.0.89"
@@ -412,7 +652,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
412652dependencies = [
413653 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
414654 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
415− "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)",
655+ "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)",
416656]
417657
418658[[package]]
@@ -432,7 +672,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
432672
433673[[package]]
434674name = "syn"
435−version = "0.15.29"
675+version = "0.15.30"
436676source = "registry+https://github.com/rust-lang/crates.io-index"
437677dependencies = [
438678 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -447,7 +687,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
447687dependencies = [
448688 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
449689 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
450− "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)",
690+ "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)",
451691 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
452692]
453693
@@ -464,11 +704,19 @@ name = "termion"
464704version = "1.5.1"
465705source = "registry+https://github.com/rust-lang/crates.io-index"
466706dependencies = [
467− "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
468− "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)",
707+ "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
708+ "redox_syscall 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)",
469709 "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
470710]
471711
712+[[package]]
713+name = "textwrap"
714+version = "0.10.0"
715+source = "registry+https://github.com/rust-lang/crates.io-index"
716+dependencies = [
717+ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
718+]
719+
472720[[package]]
473721name = "thread_local"
474722version = "0.3.6"
@@ -477,6 +725,15 @@ dependencies = [
477725 "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
478726]
479727
728+[[package]]
729+name = "tinytemplate"
730+version = "1.0.1"
731+source = "registry+https://github.com/rust-lang/crates.io-index"
732+dependencies = [
733+ "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
734+ "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
735+]
736+
480737[[package]]
481738name = "ucd-util"
482739version = "0.1.3"
@@ -487,6 +744,11 @@ name = "unicode-segmentation"
487744version = "1.2.1"
488745source = "registry+https://github.com/rust-lang/crates.io-index"
489746
747+[[package]]
748+name = "unicode-width"
749+version = "0.1.5"
750+source = "registry+https://github.com/rust-lang/crates.io-index"
751+
490752[[package]]
491753name = "unicode-xid"
492754version = "0.1.0"
@@ -502,17 +764,27 @@ name = "version_check"
502764version = "0.1.5"
503765source = "registry+https://github.com/rust-lang/crates.io-index"
504766
767+[[package]]
768+name = "walkdir"
769+version = "2.2.7"
770+source = "registry+https://github.com/rust-lang/crates.io-index"
771+dependencies = [
772+ "same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
773+ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
774+ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
775+]
776+
505777[[package]]
506778name = "wasm-bindgen"
507−version = "0.2.39"
779+version = "0.2.40"
508780source = "registry+https://github.com/rust-lang/crates.io-index"
509781dependencies = [
510− "wasm-bindgen-macro 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
782+ "wasm-bindgen-macro 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
511783]
512784
513785[[package]]
514786name = "wasm-bindgen-backend"
515−version = "0.2.39"
787+version = "0.2.40"
516788source = "registry+https://github.com/rust-lang/crates.io-index"
517789dependencies = [
518790 "bumpalo 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -520,63 +792,63 @@ dependencies = [
520792 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
521793 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
522794 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
523− "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)",
524− "wasm-bindgen-shared 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
795+ "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)",
796+ "wasm-bindgen-shared 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
525797]
526798
527799[[package]]
528800name = "wasm-bindgen-futures"
529−version = "0.3.16"
801+version = "0.3.17"
530802source = "registry+https://github.com/rust-lang/crates.io-index"
531803dependencies = [
532804 "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
533− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
534− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
805+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
806+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
535807]
536808
537809[[package]]
538810name = "wasm-bindgen-macro"
539−version = "0.2.39"
811+version = "0.2.40"
540812source = "registry+https://github.com/rust-lang/crates.io-index"
541813dependencies = [
542814 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
543− "wasm-bindgen-macro-support 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
815+ "wasm-bindgen-macro-support 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
544816]
545817
546818[[package]]
547819name = "wasm-bindgen-macro-support"
548−version = "0.2.39"
820+version = "0.2.40"
549821source = "registry+https://github.com/rust-lang/crates.io-index"
550822dependencies = [
551823 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
552824 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
553− "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)",
554− "wasm-bindgen-backend 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
555− "wasm-bindgen-shared 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
825+ "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)",
826+ "wasm-bindgen-backend 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
827+ "wasm-bindgen-shared 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
556828]
557829
558830[[package]]
559831name = "wasm-bindgen-shared"
560−version = "0.2.39"
832+version = "0.2.40"
561833source = "registry+https://github.com/rust-lang/crates.io-index"
562834
563835[[package]]
564836name = "wasm-bindgen-test"
565−version = "0.2.39"
837+version = "0.2.40"
566838source = "registry+https://github.com/rust-lang/crates.io-index"
567839dependencies = [
568840 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
569841 "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
570− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
842+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
571843 "scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
572− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
573− "wasm-bindgen-futures 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
574− "wasm-bindgen-test-macro 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
844+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
845+ "wasm-bindgen-futures 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
846+ "wasm-bindgen-test-macro 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
575847]
576848
577849[[package]]
578850name = "wasm-bindgen-test-macro"
579−version = "0.2.39"
851+version = "0.2.40"
580852source = "registry+https://github.com/rust-lang/crates.io-index"
581853dependencies = [
582854 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -585,7 +857,7 @@ dependencies = [
585857
586858[[package]]
587859name = "wasm-bindgen-webidl"
588−version = "0.2.39"
860+version = "0.2.40"
589861source = "registry+https://github.com/rust-lang/crates.io-index"
590862dependencies = [
591863 "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -593,22 +865,22 @@ dependencies = [
593865 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
594866 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
595867 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
596− "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)",
597− "wasm-bindgen-backend 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
868+ "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)",
869+ "wasm-bindgen-backend 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
598870 "weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
599871]
600872
601873[[package]]
602874name = "web-sys"
603−version = "0.3.16"
875+version = "0.3.17"
604876source = "registry+https://github.com/rust-lang/crates.io-index"
605877dependencies = [
606878 "env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
607879 "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
608− "js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
880+ "js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
609881 "sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
610− "wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
611− "wasm-bindgen-webidl 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
882+ "wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
883+ "wasm-bindgen-webidl 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
612884]
613885
614886[[package]]
@@ -616,7 +888,7 @@ name = "weedle"
616888version = "0.8.0"
617889source = "registry+https://github.com/rust-lang/crates.io-index"
618890dependencies = [
619− "nom 4.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
891+ "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
620892]
621893
622894[[package]]
@@ -656,65 +928,97 @@ dependencies = [
656928]
657929
658930[metadata]
659−"checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5"
931+"checksum aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e6f484ae0c99fec2e858eb6134949117399f222608d84cadb3f58c1f97c2364c"
932+"checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71"
660933"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
661934"checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799"
662935"checksum backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5a90e2b463010cd0e0ce9a11d4a9d5d58d9f41d4a6ba3dcaf9e68b466e88b4"
663936"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6"
937+"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
664938"checksum bumpalo 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f6a6bc2ba935b1e2f810787ceba8dfe86cbc164cee55925cae715541186673c4"
665939"checksum byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a019b10a2a7cdeb292db131fc8113e57ea2a908f6e7894b0c3c671893b65dbeb"
666−"checksum cc 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "c9ce8bb087aacff865633f0bd5aeaed910fe2fe55b55f4739527f2e023a2e53d"
940+"checksum cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "926013f2860c46252efceabb19f4a6b308197505082c609025aa6706c011d427"
941+"checksum cc 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "ad0daef304fa0b4238f5f7ed7178774b43b06f6a9b6509f6642bef4ff1f7b9b2"
667942"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4"
943+"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
944+"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
668945"checksum console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211"
669946"checksum console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e7871d2947441b0fdd8e2bd1ce2a2f75304f896582c0d572162d48290683c48"
947+"checksum criterion 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "1c6e5ee5b9652d4f851418c448af105642e1f99e9a2741a8ff45c0d2c911b1e0"
948+"checksum criterion-plot 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4107e4a5abb94267e0149922b8ff49dc70a87cc202820fdbfc0d3e1edbdc4b16"
949+"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3"
950+"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150"
951+"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9"
952+"checksum csv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd1c44c58078cfbeaf11fbb3eac9ae5534c23004ed770cc4bfb48e658ae4f04"
953+"checksum csv-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5cdef62f37e6ffe7d1f07a381bc0db32b7a3ff1cac0de56cb0d81e71f53d65"
954+"checksum either 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c67353c641dc847124ea1902d69bd753dee9bb3beff9aa3662ecf86c971d1fac"
670955"checksum env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b61fa891024a945da30a9581546e8cfaf5602c7b3f4c137a2805cf388f92075a"
671956"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
672957"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1"
958+"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
673959"checksum futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "62941eff9507c8177d448bd83a44d9b9760856e184081d8cd79ba9f03dd24981"
674960"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
675961"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
676962"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114"
963+"checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358"
677964"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
678−"checksum js-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "3970f67ef4a716efeba501dbedcc01b4686301b661798a42b24dc8a59d2c6b01"
965+"checksum js-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "d4bda84b98977341bb6ba1086ecbd9eab8bc929de0f2923c118baf76c21dd0c8"
679966"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
680−"checksum libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)" = "aab692d7759f5cd8c859e169db98ae5b52c924add2af5fbbca11d12fefb567c1"
967+"checksum libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)" = "bedcc7a809076656486ffe045abeeac163da1b558e963a31e29fbfbeba916917"
681968"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
682969"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
683−"checksum nom 4.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22293d25d3f33a8567cc8a1dc20f40c7eeb761ce83d0fcca059858580790cac3"
970+"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
971+"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
972+"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6"
973+"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1"
974+"checksum num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a23f0ed30a54abaa0c7e83b1d2d87ada7c3c23078d1d87815af3e3b6385fbba"
684975"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915"
685976"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
686977"checksum quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1"
687−"checksum redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)" = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85"
978+"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
979+"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"
980+"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
981+"checksum rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03b418169fb9c46533f326efd6eed2576699c44ca92d3052a066214a8d828929"
982+"checksum rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "373814f27745b2686b350dd261bfd24576a6fb0e2c5919b3a2b6005f820b0473"
983+"checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356"
984+"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
985+"checksum redox_syscall 0.1.52 (registry+https://github.com/rust-lang/crates.io-index)" = "d32b3053e5ced86e4bc0411fec997389532bf56b000e66cb4884eeeb41413d69"
688986"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
689−"checksum regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53ee8cfdddb2e0291adfb9f13d31d3bbe0a03c9a402c01b1e24188d86c35b24f"
690−"checksum regex-syntax 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8c2f35eedad5295fdf00a63d7d4b238135723f92b434ec06774dad15c7ab0861"
987+"checksum regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "559008764a17de49a3146b234641644ed37d118d1ef641a0bb573d146edc6ce0"
988+"checksum regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96"
691989"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619"
692990"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
991+"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
693992"checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
993+"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
694994"checksum serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)" = "92514fb95f900c9b5126e32d020f5c6d40564c27a5ea6d1d7d9f157a96623560"
695995"checksum serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6eabf4b5914e88e24eea240bb7c9f9a2cbc1bbbe8d961d381975ec3c6b806c"
696996"checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d"
697997"checksum sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3"
698−"checksum syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1825685f977249735d510a242a6727b46efe914bb67e38d30c071b1b72b1d5c2"
998+"checksum syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)" = "66c8865bf5a7cbb662d8b011950060b3c8743dca141b054bf7195b20d314d8e2"
699999"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
7001000"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f"
7011001"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
1002+"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
7021003"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
1004+"checksum tinytemplate 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7655088894274afb52b807bd3c87072daa1fedd155068b8705cabfd628956115"
7031005"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86"
7041006"checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1"
1007+"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
7051008"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
7061009"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
7071010"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
708−"checksum wasm-bindgen 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "06e36714cc3947a9c80ddc9715edb319e445e5ab0d0b083debec0dd52558580e"
709−"checksum wasm-bindgen-backend 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "6764493f6eeb3f8632ffd418bf7db6a7e7aca98417c115833e4663976cd60a5e"
710−"checksum wasm-bindgen-futures 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4327c859969477dbc2033bbbe3a6cc045cf155ef283ad9f3c2d804ba27d3fd9b"
711−"checksum wasm-bindgen-macro 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "a473501c40a2a4da83ae7176fead61f10d003554b701071a704dd0667397027a"
712−"checksum wasm-bindgen-macro-support 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "72e5a249738c6315f65ce5527632e2a3a067cdf1765422d8ac1572dcee14f819"
713−"checksum wasm-bindgen-shared 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "70f57643dac7decc3b53f0e4ffd027e225b79281648842eb46015e58a2400870"
714−"checksum wasm-bindgen-test 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "c864512cd0031acd354ba9252c27e426d95f8e7776e877104d54b2eb482999ac"
715−"checksum wasm-bindgen-test-macro 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "c9ec739799351a564254f1f8a7b2b5fdb4117e11c5ee68082e47301722d8973e"
716−"checksum wasm-bindgen-webidl 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "ef834a1f96cdc811875c00f20680bf15e038e0d0d458a82772afec5fe31ec7c1"
717−"checksum web-sys 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "a8286eada98bf34db48fc89ca53428c529a906bf161c6bae4e022f826323eb38"
1011+"checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1"
1012+"checksum wasm-bindgen 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "9742fc4860f47bede1090a5e4b0cfc33afcd70cfdf45dd28f2cfb02d4662b0dd"
1013+"checksum wasm-bindgen-backend 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c6d7f35ecbb4180513cdb9b298543321bcb278670730415cbb3205ff2c66a477"
1014+"checksum wasm-bindgen-futures 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "67bfbec85e48e8915b6acfa1c4d90b770ce033c96dc2067688f3bccd00d3b9e1"
1015+"checksum wasm-bindgen-macro 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "e3c86b06bcd28e92e87d2c2ad208889b2f69ea33f79810b91ef660cc3de65a4c"
1016+"checksum wasm-bindgen-macro-support 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "81d7338dd8c67e193d8ef18e5802dc03d8710456baa792c1c2e66847e57fd389"
1017+"checksum wasm-bindgen-shared 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "0d57c3b66f2f3e4d96b50f49b7b7e2f4cfcddc88b15744433c98c5c105b26672"
1018+"checksum wasm-bindgen-test 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "85bbc3ad78a8d59a63a02d59345e8da9a3e0c1617f79e77fd1c3da6e047db63e"
1019+"checksum wasm-bindgen-test-macro 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "114dfdf01bd3659dd79db05480fbd2751759d1c79cd9edc22f2fe611c866e932"
1020+"checksum wasm-bindgen-webidl 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "fc7052a577eefce17a439edfce5c2eedc8432fe7457bbe949624cdf946233fa7"
1021+"checksum web-sys 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "72d02003924c77af871ad74216f828b6e32af776cbb3f5dab3dcde2f2713c012"
7181022"checksum weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "26a4c67f132386d965390b8a734d5d10adbcd30eb5cc74bd9229af8b83f10044"
7191023"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
7201024"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
Cargo.toml+18
@@ -13,6 +13,17 @@ version = "0.1.0"
1313[badges]
1414travis-ci = { repository = "fitzgen/dodrio" }
1515
16+[[bench]]
17+name = "benches"
18+path = "benches/benches.rs"
19+harness = false
20+required-features = ["xxx-unstable-internal-use-only"]
21+
22+[features]
23+# Don't use this feature! It only exists for exposing otherwise-internal APIs
24+# for testing and benchmarks.
25+xxx-unstable-internal-use-only = []
26+
1627[dependencies]
1728bumpalo = "2.3.0"
1829cfg-if = "0.1.7"
@@ -50,6 +61,13 @@ features = [
5061 "NodeList",
5162]
5263
64+[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
65+criterion = "0.2.10"
66+
67+[lib]
68+path = "src/lib.rs"
69+bench = false
70+
5371[profile.release]
5472incremental = false
5573lto = true
benches/benches.rsnew file+130
@@ -0,0 +1,130 @@
1+#![cfg(all(
2+ feature = "xxx-unstable-internal-use-only",
3+ not(target_arch = "wasm32")
4+))]
5+
6+use criterion::{
7+ black_box, criterion_group, criterion_main, Benchmark, Criterion, ParameterizedBenchmark,
8+ Throughput,
9+};
10+use dodrio::{
11+ builder::*,
12+ bumpalo::{self, Bump},
13+ Node, Render, Vdom,
14+};
15+
16+/// The simplest thing we can render: `<div/>`.
17+struct Empty;
18+impl Render for Empty {
19+ fn render<'a, 'bump>(&'a self, bump: &'bump Bump) -> Node<'bump>
20+ where
21+ 'a: 'bump,
22+ {
23+ div(bump).finish()
24+ }
25+}
26+
27+/// Render a list that is `self.0` items long, has attributes and listeners.
28+struct SimpleList(usize);
29+impl Render for SimpleList {
30+ fn render<'a, 'bump>(&self, bump: &'bump Bump) -> Node<'bump>
31+ where
32+ 'a: 'bump,
33+ {
34+ let mut children = bumpalo::collections::Vec::with_capacity_in(self.0, bump);
35+ children.extend((0..self.0).map(|_| {
36+ li(bump)
37+ .attr("class", "my-list-item")
38+ .on("click", |_root, _vdom, _event| {
39+ panic!("no one should call this")
40+ })
41+ .children([text("a list item")])
42+ .finish()
43+ }));
44+ ol(bump).attr("id", "my-list").children(children).finish()
45+ }
46+}
47+
48+fn criterion_benchmark(c: &mut Criterion) {
49+ c.bench(
50+ "render",
51+ Benchmark::new("empty", {
52+ let mut bump = Bump::new();
53+ move |b| {
54+ bump.reset();
55+ b.iter(|| {
56+ black_box(Empty.render(&bump));
57+ })
58+ }
59+ }),
60+ );
61+
62+ c.bench(
63+ "render",
64+ ParameterizedBenchmark::new(
65+ "list",
66+ {
67+ let mut bump = Bump::new();
68+ move |b, n| {
69+ bump.reset();
70+ b.iter(|| {
71+ black_box(SimpleList(*n).render(&bump));
72+ })
73+ }
74+ },
75+ vec![
76+ // TODO: Only test one `n` value until
77+ // https://github.com/bheisler/criterion.rs/issues/269 is fixed.
78+ //
79+ // 100,
80+ // 1_000,
81+ 10_000,
82+ ],
83+ )
84+ .throughput(|n| Throughput::Elements(*n as u32)),
85+ );
86+
87+ c.bench(
88+ "render-and-diff",
89+ ParameterizedBenchmark::new(
90+ "same-list",
91+ |b, &n| {
92+ let vdom = Vdom::new(&(), SimpleList(n));
93+ b.iter(|| {
94+ vdom.immediately_render_and_diff(SimpleList(n));
95+ black_box(&vdom);
96+ })
97+ },
98+ vec![
99+ // TODO: Only test one `n` value until
100+ // https://github.com/bheisler/criterion.rs/issues/269 is fixed.
101+ //
102+ // 100,
103+ // 1_000,
104+ 10_000,
105+ ],
106+ )
107+ .with_function("empty-to-full-list-to-empty", |b, &n| {
108+ b.iter(|| {
109+ let vdom = Vdom::new(&(), Empty);
110+ vdom.immediately_render_and_diff(SimpleList(n));
111+ black_box(&vdom);
112+ vdom.immediately_render_and_diff(Empty);
113+ black_box(&vdom);
114+ });
115+ })
116+ .with_function("append-one-and-remove-one", |b, &n| {
117+ let vdom = Vdom::new(&(), SimpleList(n));
118+ b.iter(|| {
119+ vdom.immediately_render_and_diff(SimpleList(n + 1));
120+ black_box(&vdom);
121+ vdom.immediately_render_and_diff(SimpleList(n));
122+ black_box(&vdom);
123+ })
124+ })
125+ .throughput(|n| Throughput::Elements(*n as u32)),
126+ );
127+}
128+
129+criterion_group!(benches, criterion_benchmark);
130+criterion_main!(benches);
src/change_list.rs+59−37
@@ -2,34 +2,63 @@ use crate::Listener;
22use bumpalo::Bump;
33use fxhash::FxHashMap;
44use std::fmt;
5−use std::sync::Once;
6−use wasm_bindgen::prelude::*;
75
86pub mod js {
9− use wasm_bindgen::prelude::*;
7+ cfg_if::cfg_if! {
8+ if #[cfg(feature = "xxx-unstable-internal-use-only")] {
9+ #[derive(Clone, Debug)]
10+ pub struct ChangeList {}
11+ impl ChangeList {
12+ pub fn new(_container: &crate::Element) -> ChangeList {
13+ ChangeList {}
14+ }
15+ pub fn unmount(&self) {}
16+ pub fn add_change_list_range(&self, _start: usize, _len: usize) {}
17+ pub fn init_events_trampoline(&self, _trampoline: &crate::EventsTrampoline) {}
18+ }
19+
20+ pub fn eval_change_list() {}
21+ } else {
22+ use wasm_bindgen::prelude::*;
1023
11− #[wasm_bindgen]
12− extern "C" {
13− #[derive(Clone, Debug)]
14− pub type ChangeList;
24+ #[wasm_bindgen]
25+ extern "C" {
26+ #[derive(Clone, Debug)]
27+ pub type ChangeList;
1528
16− #[wasm_bindgen(constructor)]
17− pub fn new(container: &web_sys::Node) -> ChangeList;
29+ #[wasm_bindgen(constructor)]
30+ pub fn new(container: &web_sys::Element) -> ChangeList;
1831
19− #[wasm_bindgen(structural, method)]
20− pub fn unmount(this: &ChangeList);
32+ #[wasm_bindgen(structural, method)]
33+ pub fn unmount(this: &ChangeList);
2134
22− #[wasm_bindgen(structural, method, js_name = addChangeListRange)]
23− pub fn add_change_list_range(this: &ChangeList, start: usize, len: usize);
35+ #[wasm_bindgen(structural, method, js_name = addChangeListRange)]
36+ pub fn add_change_list_range(this: &ChangeList, start: usize, len: usize);
2437
25− #[wasm_bindgen(structural, method, js_name = applyChanges)]
26− pub fn apply_changes(this: &ChangeList, memory: JsValue);
38+ #[wasm_bindgen(structural, method, js_name = applyChanges)]
39+ pub fn apply_changes(this: &ChangeList, memory: JsValue);
2740
28− #[wasm_bindgen(structural, method, js_name = initEventsTrampoline)]
29− pub fn init_events_trampoline(
30− this: &ChangeList,
31− trampoline: &Closure<Fn(web_sys::Event, u32, u32)>,
32− );
41+ #[wasm_bindgen(structural, method, js_name = initEventsTrampoline)]
42+ pub fn init_events_trampoline(
43+ this: &ChangeList,
44+ trampoline: &crate::EventsTrampoline,
45+ );
46+ }
47+
48+ pub fn eval_change_list() {
49+ use std::sync::Once;
50+ // XXX: Because wasm-bindgen-test doesn't support third party JS
51+ // dependencies, we can't use `wasm_bindgen(module = "...")` for our
52+ // `ChangeList` JS import. Instead, this *should* be a local JS snippet,
53+ // but that isn't implemented yet:
54+ // https://github.com/rustwasm/rfcs/pull/6
55+ static EVAL: Once = Once::new();
56+ EVAL.call_once(|| {
57+ js_sys::eval(include_str!("../js/change-list.js"))
58+ .expect_throw("should eval change-list.js OK");
59+ });
60+ }
61+ }
3362 }
3463}
3564
@@ -43,7 +72,7 @@ pub(crate) struct ChangeList {
4372 strings_cache: FxHashMap<String, StringsCacheEntry>,
4473 next_string_key: u32,
4574 js: js::ChangeList,
46− events_trampoline: Option<Closure<Fn(web_sys::Event, u32, u32)>>,
75+ events_trampoline: Option<crate::EventsTrampoline>,
4776}
4877
4978impl Drop for ChangeList {
@@ -64,18 +93,8 @@ impl fmt::Debug for ChangeList {
6493}
6594
6695impl ChangeList {
67− pub(crate) fn new(container: &web_sys::Node) -> ChangeList {
68− // XXX: Because wasm-bindgen-test doesn't support third party JS
69− // dependencies, we can't use `wasm_bindgen(module = "...")` for our
70− // `ChangeList` JS import. Instead, this *should* be a local JS snippet,
71− // but that isn't implemented yet:
72− // https://github.com/rustwasm/rfcs/pull/6
73− static EVAL: Once = Once::new();
74− EVAL.call_once(|| {
75− js_sys::eval(include_str!("../js/change-list.js"))
76− .expect("should eval change-list.js OK");
77− });
78−
96+ pub(crate) fn new(container: &crate::Element) -> ChangeList {
97+ js::eval_change_list();
7998 let bump = Bump::new();
8099 let strings_cache = FxHashMap::default();
81100 let js = js::ChangeList::new(container);
@@ -88,6 +107,12 @@ impl ChangeList {
88107 }
89108 }
90109
110+ #[cfg(feature = "xxx-unstable-internal-use-only")]
111+ pub(crate) fn apply_changes(&mut self) {
112+ // Do nothing...
113+ }
114+
115+ #[cfg(not(feature = "xxx-unstable-internal-use-only"))]
91116 pub(crate) fn apply_changes(&mut self) {
92117 let js = &self.js;
93118 unsafe {
@@ -99,10 +124,7 @@ impl ChangeList {
99124 self.bump.reset();
100125 }
101126
102− pub(crate) fn init_events_trampoline(
103− &mut self,
104− trampoline: Closure<Fn(web_sys::Event, u32, u32)>,
105− ) {
127+ pub(crate) fn init_events_trampoline(&mut self, trampoline: crate::EventsTrampoline) {
106128 debug_assert!(self.events_trampoline.is_none());
107129 self.js.init_events_trampoline(&trampoline);
108130 self.events_trampoline = Some(trampoline);
src/events.rs+103−84
@@ -1,98 +1,117 @@
1−use crate::vdom::{VdomInner, VdomWeak};
2−use crate::{Listener, ListenerCallback};
1+use crate::vdom::VdomInner;
2+use crate::Listener;
33use std::cell::RefCell;
4−use std::collections::HashMap;
5−use std::fmt;
6−use std::mem;
74use std::rc::{Rc, Weak};
8−use wasm_bindgen::closure::Closure;
9−use wasm_bindgen::prelude::*;
105
11−/// The events registry manages event listeners for a virtual DOM.
12−///
13−/// The events registry is persistent across virtual DOM rendering and double
14−/// buffering.
15−pub(crate) struct EventsRegistry {
16− vdom: Weak<VdomInner>,
17− active: HashMap<(u32, u32), ListenerCallback<'static>>,
18−}
6+cfg_if::cfg_if! {
7+ if #[cfg(feature = "xxx-unstable-internal-use-only")] {
8+ #[derive(Debug)]
9+ pub(crate) struct EventsRegistry {}
10+ impl EventsRegistry {
11+ pub(crate) fn new(_vdom: Weak<VdomInner>) -> (
12+ Rc<RefCell<EventsRegistry>>,
13+ crate::EventsTrampoline,
14+ ) {
15+ (Rc::new(RefCell::new(EventsRegistry {})), ())
16+ }
17+ pub(crate) unsafe fn add<'a>(&mut self, _listener: &'a Listener<'a>) {}
18+ pub(crate) fn clear_active_listeners(&mut self) {}
19+ }
20+ } else {
21+ use crate::{ListenerCallback, vdom::VdomWeak};
22+ use std::collections::HashMap;
23+ use std::fmt;
24+ use std::mem;
25+ use wasm_bindgen::closure::Closure;
26+ use wasm_bindgen::prelude::*;
1927
20−impl fmt::Debug for EventsRegistry {
21− fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
22− f.debug_struct("EventsRegistry")
23− .field("active", &self.active.keys().collect::<Vec<_>>())
24− .finish()
25− }
26−}
28+ /// The events registry manages event listeners for a virtual DOM.
29+ ///
30+ /// The events registry is persistent across virtual DOM rendering and double
31+ /// buffering.
32+ pub(crate) struct EventsRegistry {
33+ vdom: Weak<VdomInner>,
34+ active: HashMap<(u32, u32), ListenerCallback<'static>>,
35+ }
2736
28−impl EventsRegistry {
29− /// Construct a new events registry and JS function trampoline that weakly
30− /// holds the new registry and can be used by JS to invoke listeners on the
31− /// Rust side.
32− pub(crate) fn new(
33− vdom: Weak<VdomInner>,
34− ) -> (
35− Rc<RefCell<EventsRegistry>>,
36− Closure<Fn(web_sys::Event, u32, u32)>,
37− ) {
38− let registry = Rc::new(RefCell::new(EventsRegistry {
39− vdom,
40− active: HashMap::new(),
41− }));
37+ impl fmt::Debug for EventsRegistry {
38+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
39+ f.debug_struct("EventsRegistry")
40+ .field("active", &self.active.keys().collect::<Vec<_>>())
41+ .finish()
42+ }
43+ }
4244
43− let weak_registry = Rc::downgrade(&registry);
44− let closure = Closure::wrap(Box::new(move |event, a, b| {
45− debug!("Events trampoline invoked with (0x{:x}, 0x{:x})", a, b);
46− debug_assert!(a != 0);
45+ impl EventsRegistry {
46+ /// Construct a new events registry and JS function trampoline that weakly
47+ /// holds the new registry and can be used by JS to invoke listeners on the
48+ /// Rust side.
49+ pub(crate) fn new(
50+ vdom: Weak<VdomInner>,
51+ ) -> (
52+ Rc<RefCell<EventsRegistry>>,
53+ crate::EventsTrampoline,
54+ ) {
55+ let registry = Rc::new(RefCell::new(EventsRegistry {
56+ vdom,
57+ active: HashMap::new(),
58+ }));
4759
48− // if the VdomInnerExclusive is keeping this closure alive, then the
49− // VdomInnerExclusive should also be keeping the registry alive
50− let registry = weak_registry.upgrade().unwrap_throw();
51− let registry = registry.borrow();
60+ let weak_registry = Rc::downgrade(&registry);
61+ let closure = Closure::wrap(Box::new(move |event, a, b| {
62+ debug!("Events trampoline invoked with (0x{:x}, 0x{:x})", a, b);
63+ debug_assert!(a != 0);
5264
53− match registry.active.get(&(a, b)) {
54− None => warn!(
55− "EventsRegistry closure invoked with unknown listener parts: \
56− (0x{:x}, 0x{:x})",
57− a, b
58− ),
59− Some(callback) => {
60− let vdom = registry.vdom.upgrade().expect_throw(
61− "if the registry is still around, then the vdom should still be around",
62− );
63− let vdom_weak = VdomWeak::new(&vdom);
64− let mut vdom = vdom.exclusive.borrow_mut();
65− let component = vdom.component_raw_mut();
66− callback(component, vdom_weak, event);
67− }
68− }
69− }) as Box<Fn(web_sys::Event, u32, u32)>);
65+ // if the VdomInnerExclusive is keeping this closure alive, then the
66+ // VdomInnerExclusive should also be keeping the registry alive
67+ let registry = weak_registry.upgrade().unwrap_throw();
68+ let registry = registry.borrow();
7069
71− (registry, closure)
72− }
70+ match registry.active.get(&(a, b)) {
71+ None => warn!(
72+ "EventsRegistry closure invoked with unknown listener parts: \
73+ (0x{:x}, 0x{:x})",
74+ a, b
75+ ),
76+ Some(callback) => {
77+ let vdom = registry.vdom.upgrade().expect_throw(
78+ "if the registry is still around, then the vdom should still be around",
79+ );
80+ let vdom_weak = VdomWeak::new(&vdom);
81+ let mut vdom = vdom.exclusive.borrow_mut();
82+ let component = vdom.component_raw_mut();
83+ callback(component, vdom_weak, event);
84+ }
85+ }
86+ }) as Box<Fn(web_sys::Event, u32, u32)>);
7387
74− /// Add an event listener to the registry, exposing to JS.
75− ///
76− /// # Unsafety
77− ///
78− /// The listener's lifetime is extended to `'static` and it is the caller's
79− /// responsibility to ensure that the listener is not kept in the registry
80− /// after it is dropped. This is typically done via clearing the whole
81− /// registry on each render and repopulating it during diffing.
82− pub(crate) unsafe fn add<'a>(&mut self, listener: &'a Listener<'a>) {
83− let id = listener.get_callback_parts();
84− debug!("EventsRegistry::add(0x{:x}, 0x{:x})", id.0, id.1);
85− debug_assert!(id.0 != 0);
88+ (registry, closure)
89+ }
8690
87− let callback =
88− mem::transmute::<ListenerCallback<'a>, ListenerCallback<'static>>(listener.callback);
89− let old = self.active.insert(id, callback);
90− debug_assert!(old.is_none());
91− }
91+ /// Add an event listener to the registry, exposing to JS.
92+ ///
93+ /// # Unsafety
94+ ///
95+ /// The listener's lifetime is extended to `'static` and it is the caller's
96+ /// responsibility to ensure that the listener is not kept in the registry
97+ /// after it is dropped. This is typically done via clearing the whole
98+ /// registry on each render and repopulating it during diffing.
99+ pub(crate) unsafe fn add<'a>(&mut self, listener: &'a Listener<'a>) {
100+ let id = listener.get_callback_parts();
101+ debug!("EventsRegistry::add(0x{:x}, 0x{:x})", id.0, id.1);
102+ debug_assert!(id.0 != 0);
92103
93− /// Clear all event listeners from the registry.
94− pub(crate) fn clear_active_listeners(&mut self) {
95− debug!("EventsRegistry::clear_active_listeners()");
96− self.active.clear();
104+ let callback =
105+ mem::transmute::<ListenerCallback<'a>, ListenerCallback<'static>>(listener.callback);
106+ let old = self.active.insert(id, callback);
107+ debug_assert!(old.is_none());
108+ }
109+
110+ /// Clear all event listeners from the registry.
111+ pub(crate) fn clear_active_listeners(&mut self) {
112+ debug!("EventsRegistry::clear_active_listeners()");
113+ self.active.clear();
114+ }
115+ }
97116 }
98117}
src/lib.rs+14
@@ -80,3 +80,17 @@ pub use self::cached::Cached;
8080pub use self::node::{Attribute, ElementNode, Listener, ListenerCallback, Node, TextNode};
8181pub use self::render::{Render, RootRender};
8282pub use self::vdom::{Vdom, VdomWeak};
83+
84+cfg_if::cfg_if! {
85+ if #[cfg(feature = "xxx-unstable-internal-use-only")] {
86+ /// An element node in the physical DOM.
87+ pub type Element = ();
88+
89+ pub(crate) type EventsTrampoline = ();
90+ } else {
91+ /// An element node in the physical DOM.
92+ pub type Element = web_sys::Element;
93+
94+ pub(crate) type EventsTrampoline = wasm_bindgen::closure::Closure<Fn(web_sys::Event, u32, u32)>;
95+ }
96+}
src/vdom.rs+48−20
@@ -56,7 +56,7 @@ pub(crate) struct VdomInnerExclusive {
5656
5757 dom_buffers: [Bump; 2],
5858 change_list: ManuallyDrop<ChangeList>,
59− container: web_sys::Element,
59+ container: crate::Element,
6060 events_registry: Option<Rc<RefCell<EventsRegistry>>>,
6161
6262 // Actually a reference into `self.dom_buffers[0]` or if `self.component` is
@@ -109,7 +109,36 @@ impl Drop for VdomInnerExclusive {
109109 let mut registry = registry.borrow_mut();
110110 registry.clear_active_listeners();
111111
112− self.container.set_inner_html("");
112+ empty_container(&self.container);
113+ }
114+}
115+
116+cfg_if::cfg_if! {
117+ if #[cfg(feature = "xxx-unstable-internal-use-only")] {
118+ fn empty_container(_container: &crate::Element) {}
119+ fn initialize_container(_container: &crate::Element) {}
120+ } else {
121+ fn empty_container(container: &crate::Element) {
122+ container.set_inner_html("");
123+ }
124+
125+ fn initialize_container(container: &crate::Element) {
126+ empty_container(container);
127+
128+ // Create the dummy `<div/>` child in the container.
129+ let window = web_sys::window().expect_throw("should have access to the Window");
130+ let document = window
131+ .document()
132+ .expect("should have access to the Document");
133+ container
134+ .append_child(
135+ document
136+ .create_element("div")
137+ .expect("should create element OK")
138+ .as_ref(),
139+ )
140+ .expect("should append child OK");
141+ }
113142 }
114143}
115144
@@ -118,7 +147,7 @@ impl Vdom {
118147 /// rendering component.
119148 ///
120149 /// This will box the given component into trait object.
121− pub fn new<R>(container: &web_sys::Element, component: R) -> Vdom
150+ pub fn new<R>(container: &crate::Element, component: R) -> Vdom
122151 where
123152 R: RootRender,
124153 {
@@ -127,31 +156,17 @@ impl Vdom {
127156
128157 /// Construct a `Vdom` with the already-boxed-as-a-trait-object root
129158 /// rendering component.
130− pub fn with_boxed_root_render(
131− container: &web_sys::Element,
159+ pub fn with_boxed_root_render<'a, 'bump>(
160+ container: &crate::Element,
132161 component: Box<RootRender>,
133162 ) -> Vdom {
134163 let dom_buffers = [Bump::new(), Bump::new()];
135164 let change_list = ManuallyDrop::new(ChangeList::new(container));
136165
137− // Ensure that the container is empty.
138− container.set_inner_html("");
139−
140166 // Create a dummy `<div/>` in our container.
167+ initialize_container(container);
141168 let current_root = Node::element(&dom_buffers[0], "div", [], [], [], None);
142169 let current_root = Some(unsafe { extend_node_lifetime(current_root) });
143− let window = web_sys::window().expect("should have access to the Window");
144− let document = window
145− .document()
146− .expect("should have access to the Document");
147− container
148− .append_child(
149− document
150− .create_element("div")
151− .expect("should create element OK")
152− .as_ref(),
153− )
154− .expect("should append child OK");
155170
156171 let container = container.clone();
157172 let inner = Rc::new(VdomInner {
@@ -182,6 +197,19 @@ impl Vdom {
182197 Vdom { inner }
183198 }
184199
200+ /// Immediately re-render and diff. Only for internal testing and
201+ /// benchmarking purposes.
202+ #[cfg(feature = "xxx-unstable-internal-use-only")]
203+ pub fn immediately_render_and_diff<R>(&self, component: R)
204+ where
205+ R: RootRender,
206+ {
207+ let mut exclusive = self.inner.exclusive.borrow_mut();
208+ let component = Box::new(component) as Box<RootRender>;
209+ exclusive.component = Some(component);
210+ exclusive.render();
211+ }
212+
185213 /// Run this virtual DOM and its listeners forever and never unmount it.
186214 #[inline]
187215 pub fn forget(self) {