For large JSON-compatible objects, JSON.parse is faster than JS object literals.
True for all browser JavaScript engines!
Speed-ups from 1.2× to 2×
My #ChromiumDevSummit lightning talk explains why:https://www.youtube.com/watch?v=ff4fgQxPaO0 …
-
-
Did you see the benchmark referenced in the talk? It includes warm load tests: https://github.com/GoogleChromeLabs/json-parse-benchmark/blob/7ffba303e10910faa93cab2ba9bd643c8686a995/bench.sh#L37-L40 … cc
@leszekswirski@tverwaes for code caching insights specifically -
The trade-off space here is pretty large - with code caching specifically, you save on parsing but you pay for deserialisation of the strings and object boilerplates. For multiple initialisations it still makes sense, but for a single one it's a bit of a toss up.
- Još 4 druga odgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.