[Webkit-unassigned] [Bug 17510] Acid3 test 26 takes >33ms

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 25 16:12:00 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=17510





------- Comment #35 from mjs at apple.com  2008-05-25 16:11 PDT -------
(In reply to comment #33)
> 
> 
> > E) We could avoid making a lot of JS string wrappers if we could create code
> > paths that would keep the UString in the engine register until the value needs
> > to be used as a generic value. The expression "iteration " + i + " failed"
> > results in creation of many string wrappers and it's never used for anything at
> > all. Similarly, the expression "iteration " + i + " at " + d results in the
> > creation of many string wrappers and ultimately it's passed to createTextNode,
> > which takes a string parameter rather than an arbitrary object value. I suspect
> > that we could speed up by more than 5% by reducing the number of string
> > wrappers if we could get the strings to the "+" operator and to the function
> > call without converting to a wrapper, but that's probably a tall order.
> 
> I think we can make a significant improvement without changing the register
> representation, and adding only two opcodes. But I am not sure how general the
> optimization is. Here's the idea:

Some clarifiaction.

> 
> a) The condition for this to apply is an AddNode chain where the leftmost
> operand is a constant string (this means every addition is a string add). You
> have to be careful though because "xx" + (i + z) can't assume all string adds.
> 
> b) In this case, emit code to load the constant string operands and convert
> non-string operands to string (with a new tostring opcode) to sequential
> registers.

On second thought, the append_strings opcode could do any needed string
conversion, so it could be done with only one extra opcode.

> c) Emit a new append_strings opcode which assumes all operands are primitive
> strings, and concatenates them at one go into a fresh UString. This would both
> reduce allocation work in UString (can do multiple appends all at once) and
> reduce the number of temporaries created (in "iteration " + i + " at " + d, i
> and d are still converted to string resulting in temporaries, but the GC values
> for "iteration " + i and "iteration " + i + " at " need never be created,
> cutting the number of unobserved string temporaries in half).

The append_strings opcode would take a starting register and a register count
(or ending register) as its parameters. Outputting to the right registers could
be handled as for function call parameters.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list