Status: Accepted
Owner: ----
CC: [email protected]
Labels: Type-FeatureRequest Priority-Medium

New issue 445 by [email protected]: Access to non-existing object property  
is slow
http://code.google.com/p/v8/issues/detail?id=445

Migrating from: http://code.google.com/p/chromium/issues/detail?id=22212

There is a script to run, it alerts the access times.
The access to not existing property by constant is about 10x slower than
by computed name and about 200x slower than to existing property.

<html>
<body>
<script>

function Test(){
var O = {};

var D1 = new Date();
for(var i=0;i<1000000;i++) O.Test;

var D2 = new Date();
var name = "Te"+"st";
for(var i=0;i<1000000;i++) O[name];

O.Test = null;

var D3 = new Date();
for(var i=0;i<1000000;i++) O.Test;

var D4 = new Date();
var name = "Te"+"st";
for(var i=0;i<1000000;i++) O[name];

alert("not existing constant:   "+(D2-D1)+"  \nnot existing computed:   "+
(D3-D2)+"  \nexisting constant:   "+(D4-D3)+"  \nexisting computed:   "+
(new Date()-D4));
}

Test();

</script>
</body>
</html>

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to