cssinjs / cssinjs/istf-spec

Optimization using JSON.parse

Open
#31 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
250
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Today I read a [blogpost](https://tomdale.net/2017/07/adventures-in-microbenchmarking/) by @tomdale. It states that JSON.parse is faster by 18x than eval. When we evaluate our script with ISTF, it is basically an eval I assume.

As in our format, the only pure JS part is functions, we can put them into a separate array, stringify everything else and JSON.parse at runtime. Lets see if this can yeld any reasonable perf improvements for us.

Alternatively we can also try Array#join and Array#split, as we have no objects.

Also see #22 and #19

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.