3

I'm working on a node.js application and I have some large objects I need to stringify before I save them into a database. I know speed and resource usage are complementary, so I am wondering if a JSON.stringify implementation trading speed for a smaller memory usage exists. Right now, given enough memory, the stringify operation is taking a few seconds. I don't mind if it would take 5 minutes to stringify it, as long as the memory usage is reduced. So, do you know of any implementation trading speed for a smaller resource (especially memory) usage?

icenac
  • 400
  • 4
  • 11
  • If it were files, I'd suggest a streamable JSON implementation, but since you're saving into a DB, you need the whole string in memory anyways – georg Feb 05 '15 at 10:46
  • The stringified JSON itself is not that big (only a few tens of MB). The process of stringifiation on the other hand takes a lot of memory. – icenac Feb 05 '15 at 10:54

0 Answers0