Implement caching in the JS version #138

Merged
devongovett merged 6 commits from js-caching into master 2015-10-04 16:07:45 -07:00
devongovett commented 2015-10-04 11:52:34 -07:00 (Migrated from github.com)

This implements caching for the JS version, as suggested by @vjeux in #137. Here's the results of the same benchmark I used before, compared to the current master (after my previous optimizations):

new x 270 ops/sec ±122.16% (94 runs sampled)
old x 22.76 ops/sec ±4.21% (43 runs sampled)
new is the fastest
old is 92% slower
This implements caching for the JS version, as suggested by @vjeux in #137. Here's the results of the same benchmark I used before, compared to the current master (after my previous optimizations): ``` new x 270 ops/sec ±122.16% (94 runs sampled) old x 22.76 ops/sec ±4.21% (43 runs sampled) new is the fastest old is 92% slower ```
vjeux commented 2015-10-04 12:38:36 -07:00 (Migrated from github.com)

This is awesome :)

Would you mind sending a pull request with the benchmark as well, this way other people working on optimizations can have some kind of reference to play with

This is awesome :) Would you mind sending a pull request with the benchmark as well, this way other people working on optimizations can have some kind of reference to play with
devongovett commented 2015-10-04 12:43:08 -07:00 (Migrated from github.com)

Actually... the benchmark results above are not really valid since it used the same tree every run, so everything was cached (duh). Still way better though if you're just modifying a child rather than the whole tree. I'll update it.

Actually... the benchmark results above are not really valid since it used the same tree every run, so everything was cached (duh). Still way better though if you're just modifying a child rather than the whole tree. I'll update it.
devongovett commented 2015-10-04 14:21:00 -07:00 (Migrated from github.com)

Fixed nits and added node.isDirty, and node.shouldUpdate support. Also has to reset child layouts for any invalidated nodes before recomputing or the results will be wrong.

Fixed nits and added node.isDirty, and node.shouldUpdate support. Also has to reset child layouts for any invalidated nodes before recomputing or the results will be wrong.
devongovett commented 2015-10-04 14:38:20 -07:00 (Migrated from github.com)

Updated.

Updated.
Sign in to join this conversation.
No description provided.