4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

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
2 upvotes $0.00

Replies (1)

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: