Status: New
Owner: ----
New issue 3555 by [email protected]: Possibly memory bug in Webkit when
saving references to DOM nodes
https://code.google.com/p/v8/issues/detail?id=3555
I noticed something odd when trying to profile the performance of creating
different types of 'classes' in Chrome 37 a week ago.
When I created a new Function and added methods to it, it was faster than
creating a new object with those methods as its prototype. This was
obviously wrong.
After looking into it more, it became apparent that whichever of my test
loops was called first ran much faster than subsequent loops of other
constructors. This seems to only be true if the constructor saves a
reference to a DOM node, and only in Webkit browsers.
What steps will reproduce the problem?
1. Use the code in the reduced usecase jsperf below
2. Reverse the order of the first 2 tests ( as seen in the reduced inverse)
3. In Webkit browsers, the first test will perform more operations than
following tests, but with similar ratios.
What is the expected result?
Results more like seen in Firefox, with higher performance all around and
extending a Function significantly slower than using a prototype.
What happens instead?
Extending a Function seems to hinder later performance of calling a new
prototype.
Original Test Case:
http://jsperf.com/different-types-of-constructors-vs-extend
Reduced Test Case: http://jsperf.com/func-vs-proto-reduced
Reduced Test Case Inverse: http://jsperf.com/proto-vs-func-reduced
'Fixed' Test Case with DOM reference removed:
http://jsperf.com/different-types-of-constructors-vs-extend/2
Notice that the test Cases have the same performance in Firefox, while
Chrome performs better on whichever is called first, but much worse
overall. This is not true in the 'fixed' test case where no DOM
manipulation occurs. There are a few other browsers and operating systems
in the original test case.
I apologize if this doesn't belong here. I'm not very clear if this is a
real "bug", or just a performance hiccup only apparent in this specific
code. I'm also not clear even if it is a real bug whether it would be a v8
or a Webkit problem.
--
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/d/optout.