-
Notifications
You must be signed in to change notification settings - Fork 89
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change! I think there's a lot to win by doing this in -vm
and every other async-heavy package.
Ran the benchmarks against both builds and these doesn't seem to show significant difference on first sight: dist $ npm run benchmarks
benchmarks/random.ts | rounds: 1000, ERA_SIZE: 1000, sys: 1663.196ms
benchmarks/checkpointing.ts | average execution time: 0.05s 377.844ms
$ npm run benchmarks
benchmarks/random.ts | rounds: 1000, ERA_SIZE: 1000, sys: 2068.566ms
benchmarks/checkpointing.ts | average execution time: 0.1s 383.173ms dist.browser $ npm run benchmarks
benchmarks/random.ts | rounds: 1000, ERA_SIZE: 1000, sys: 1856.385ms
benchmarks/checkpointing.ts | average execution time: 0.05s 390.474ms
$ npm run benchmarks
benchmarks/random.ts | rounds: 1000, ERA_SIZE: 1000, sys: 1598.650ms
benchmarks/checkpointing.ts | average execution time: 0.05s 358.461ms (on Node |
@alcuadrado How does this work with tools (you mentioned |
Web bundlers just use the |
How are you running the benchmarks? They get the implementation from |
@alcuadrado Just manually pointing to |
Here are the benchmarks that we did. Also @alcuadrado had significant performance improvements on the vm side when compiling it with ES2017 target. Note that those benchmarks were done on node 11 and there is no benchmark for master with ES2017 v3.0.0 (js)
mpt master branch (at
|
Would love to hear some more voices from the team or from others here: is this something we should consider to roll out (over time) to the other libraries as well? Any further input on side effects which might occur hear due to a) the switch in specific and/or b) general ecosystem and tool(chain) compatibility? Is this sufficiently integrated in the tests respectively ideas or suggestions on this front? |
Hi Piotr @sz-piotr, thanks, great that you are doing this work, performance is really under-appreciated throughout the EthereumJS ecosystem! 👍 😄 I never looked closer to the MPT benchmark files, did you build up some trust on that these deliver valid results? And can you give some interpretation to the benchmark results you posted (so: what would you read out of the results respectively what conclusions would you regard as "safe to be drawn"?) I would love to have these improved VM results a bit more transparent, can you or @alcuadrado eventually do some kind of test PR towards the VM to get some impression on the effect on CI? |
@holgerd77 That is the idea. We are currently investigating the impact of the changes and trying to build credible benchmarks that are a little bit more transparent and robust. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed this again, LGTM
@sz-piotr and @msieczko suggested to use a ES2017 build for the performance benefit of not using ts generators for async code.
@alcuadrado highlighted the importance of maintaining browser support and suggested using the
browser
field inpackage.json
.This PR makes
dist
a ES2017 build and adds an additional build atdist.browser
for ES5 (as inspired by this post).