Jest reduced their test runner time by 20% by switching from plain JavaScript objects to Maps where it made sense. https://github.com/facebook/jest/pull/6960 …
In general, don’t be afraid to use modern features! Focus on writing idiomatic code, and let JS engines worry about making it fast.
-
-
Does this advice still apply if you have thousands of tables with few or zero items in each table?
-
Yes. Why wouldn’t it?
- 1 more reply
New conversation -
-
-
...as long as you don't need to serialize it.
-
We do serialize it and it's even faster than serializing objects. The hidden trick is that we use v8 serialization (read&written using Node) instead of JSON.
End of conversation
New conversation -
-
-
I'd add "if you don't need to clone them" - which is way slower using Maps: https://esbench.com/bench/5b9b70d4f2949800a0f62058 …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
How does that compare to Object.create(null)?
-
Ah, I should have RTFPR, because it jest were using Object.create(null), as
@Jason_williams mentionshttps://twitter.com/Jason_williams/status/1040512363198328832?s=19 …
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.