benckmarking the known problem of blocking JSON.stringify, a common bottleneck for NodeJS programs
cpu benchmark on JSON.stringify and its alternatives.
use code from https://github.com/CLDH214/cpu-benchmark.
A 524.288019 MB JSON string takes up to 100% CPU on my 3.5 GHz Quad-Core Intel Core i5
when it is being stringified with JSON.stringify
.
A half sized (209.715219 MB) JSON string takes up to 100% CPU with the yieldable-json library too.
You can replicate normal JSON.stringify by
docker build -t sugar/cpu-benchmark .
docker run sugar/cpu-benchmark:latest
docker stats
You can replicate yieldable-json by
- (make sure your toggle the Docker>preferences>Advanced memory section to be larger than 8GB first)
docker build -f Dockerfile-yieldable -t sugar/cpu-benchmark-yieldable .
docker run -m=8g sugar/cpu-benchmark-yieldable:latest
docker stats
Congratulations @guesshu! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!