Skip to content

Instantly share code, notes, and snippets.

@metamatt
Created November 13, 2014 19:54
Show Gist options
  • Save metamatt/2fedb9249a2b06ebfb83 to your computer and use it in GitHub Desktop.
Save metamatt/2fedb9249a2b06ebfb83 to your computer and use it in GitHub Desktop.
v8 does not intern strings that are identical, at least not if they're big. You can see distinct string objects in the heap dump.
require('webkit-devtools-agent')
b1 = fs.readFileSync('/usr/bin/nodejs')
b2 = fs.readFileSync('/usr/bin/nodejs')
c1 = b1.toString(); 0
c2 = b2.toString(); 0
c1 === c2 // true!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment