Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
What's different of requiring json or js?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kei Son  
View profile  
 More options Aug 7 2012, 12:17 pm
From: Kei Son <hey.calmd...@gmail.com>
Date: Tue, 7 Aug 2012 09:17:32 -0700 (PDT)
Local: Tues, Aug 7 2012 12:17 pm
Subject: What's different of requiring json or js?

(copied my issue from nodejs group:  
https://groups.google.com/forum/?fromgroups#!topic/nodejs/adowj-PAJfo)

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?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »