I don’t know who needs to hear this but, having been looking at performance characteristics of JSON in Node.js today:

- JSON.stringify (synchronous) is blisteringly fast on regular JavaScript objects/arrays, etc.
- JSON.stringify is an order of magnitude slower when used with Proxy
- The fastest yielding module I could find (yieldableJSON) is an order of magnitude slower than JSON.stringify.

Also, { performance } = require('perf_hooks'); performance.now() is your friend ;)

@aral accepting the overall performance hit might be worth it for being non blocking.

on the other hand, workers might be a better way to get there.

@zensaiyuki Yeah, if you’re working with huge data, definitely. But with 1,000,000 records of my test database I’m closing ~600ms on writes (~150MB table) so that’s acceptable for me (given that I don’t expect to reach 100,000 records for my use case in actual use and writes are ~50ms at that stage). Basically, if we ever reach 100K for this use case, it would mean we’re making ~€200K/month and thus we should be trying harder to devolve accounts AWAY from us, not to us so as not to centralise :)

Sign in to participate in the conversation
Aral’s Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!