Status: New
Owner: ----
New issue 3144 by [email protected]: poor performance on property
lookup when the key is the result of a string concat
http://code.google.com/p/v8/issues/detail?id=3144
I know we should leave micro benchmarks to the VM implementers, and I am
sure some bugs/issues exist with my benchmark, but the performance
difference appears measurable, even in real scenarios.
I was able to get some noticeable improvements in some situations, by
avoiding this. Unfortunately, this isn't always practical/possible.
Summary:
```js
var KEY = 'fast_key';
var KEY_FROM_CONCAT = 'fast_' + 'key';
var obj = { };
obj[KEY] = 'foo';
obj[KEY_FROM_CONCAT] = 'foo';
obj[KEY] // will peform much faster then
obj[KEY_FROM_CONCAT] // <-- slower
```
simple runnable example:
https://gist.github.com/stefanpenner/ede92fbd00bf49bc5f09
benchmark: http://jsperf.com/lookup-key-length/2
It appears other runtimes, the various monkeys powering firefox, and
squirrels powering Safari's don't have incur this same penalty.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.