4 ms·
I vaguely recall seeing a Mozilla presentation while back saying that they had gone to using 64 bits to store JS variables even on 32-bit machines - this was fa
by archangel_one 15y ago
I vaguely recall seeing a Mozilla presentation while back saying that they had gone to using 64 bits to store JS variables even on 32-bit machines - this was faster since doubles then fit directly, but presumably on a 64-bit machine it would get faster again.
Edit: http://hacks.mozilla.org/2011/03/firefox4-performance/ http://hacks.mozilla.org/2011/03/firefox4-performance/ refers to 64-bit NaN boxing and links to the article I was thinking of, but unfortunately that seems to be broken.
- danwolff 15y ago"NaN-tagging: 64 bit tagged values are used for stack slots and table slots. Unboxed floating-point numbers (doubles) are overlayed with tagged object references. The latter can be distinguished from numbers via the use of special NaNs as tags. It's a remote descendant of pointer-tagging. [The idea dates back to 2006, but I haven't disclosed it before 2008. Special NaNs have been used to overlay pointers before. Others have used it for tagging later on. The specific layout is of my own devising.]" [1] [1] http://article.gmane.org/gmane.comp.lang.lua.general/58908 http://article.gmane.org/gmane.comp.lang.lua.general/58908
- kenjackson 15y agoInteresting, but I don't think I fully understand when you'd use it. Why would you need to couple object references with floating-point values?
- danwolff 15y agoUneducated conjecture: They're not just any floating points, they are doubles. You need twice the capacity of one (32-bit double) in order to fake 64 bits. I assume that this helps meet the requirements of other pieces being hacked together.