Thanks for the idea. But I just want to know why. 2012년 8월 6일 월요일 오전 9시 58분 22초 UTC+9, Marak Squires 님의 말: > > You might want to consider using a streaming JSON parser. > > On Sat, Aug 4, 2012 at 7:43 AM, Kei Son <[email protected]> wrote: > >> I have a huge JSON file, right, it's 78MB. >> When I just require it from node-cli it takes 450MB memory footprint. I >> can understand that is bloated 6x times because the JSON file is just a >> string in the storage, but it needs spaces for indexing, making some >> padding, optimization, linking and whatever else when it comes on memory. >> >> But the other hand, when I add some strings like "module.exports=" at the >> top of the JSON file and require it as a normal js file, it takes only >> 200MB. I thought requiring as JSON would be faster and smaller than as JS. >> Because there are no seeking time for code-optimization and no extra >> process at the Node.js side. >> >> What's different between two and why? >> >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/nodejs?hl=en?hl=en >> > >
-- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
