Closed Bug 910795 Opened 11 years ago Closed 11 years ago

Investigate solutions to the slowdown caused by variadic string arguments

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: julienw, Assigned: bzbarsky)

Details

Attachments

(2 files)

From bug 814014 comment 41: 1) Using a variadic means we have to copy the string, since the type is nsTArray<nsString>. This involves an allocation of the copied data and then a deallocation. In this testcase those make up, between the two of them, 42% of the post-change time (so about 180ns: 3x what the entire call used to take). For the specific case of variadic string arguments, we _could_ try using an nsTArray<FakeDependentString> or some such. It would be annoying, but... Alternately we could try something where we use nsTArray<nsString> but rebind it as a dependent string.
I have some patches that avoid the string copy and speed up the toggle() and add() testcases by about 2x as a result...
Assignee: nobody → bzbarsky
Summary: Investigate solutions to the slowdown caused by variadic arguments → Investigate solutions to the slowdown caused by variadic string arguments
Whiteboard: [need review]
Version: 22 Branch → Trunk
Comment on attachment 797437 [details] [diff] [review] part 2. Use the new Rebind() setup to avoid creating string copies for variadic string arguments. uh, aTokens. How did that pass my eyes. Could you rename to tokens
Attachment #797437 - Flags: review?(bugs) → review+
> Could you rename to tokens Done.
Attachment #797436 - Flags: review?(benjamin) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: