How does JavaScript VM implements Object property access? Is it Hashtable?

V8 doesn’t implement Object properties access as hashtable, it actually implement it in a better way (performance wise)

So how does it work? “V8 does not use dynamic lookup to access properties. Instead, V8 dynamically creates hidden classes behind the scenes” – that make the access to properties almost as fast as accessing properties of C++ objects.

Why? because in fixed class each property can be found on a specific fixed offset location..

So in general accessing property of an object in V8 is faster than Hashtable..

I’m not sure how it works on other VMs

More info can be found here: https://v8.dev/blog/fast-properties

You can also read more regarding Hashtable in JS here:(my blog) http://simplenotions.wordpress.com/2011/07/05/javascript-hashtable/

Leave a Comment