Consider the attached testcase, which passes a long string through Web IDL to a callee that just saves it. The string originally came out of Web IDL bindings, and hence is an external stringbuffer-backed string. With our current setup, that causes a copy on the callee side, and copying a long string takes a while. The testcase outputs the average time per call, in ns. In an unmodified build I see times on the order of 600 us (600,000 ns) per call. With my changes I see times on the order of 100ns per call, at the iteration count in the testcase; it gets even faster (~30-40ns) with more iterations and better JIT-compilation.
Bug 1591481 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Consider the attached testcase, which passes a long string through Web IDL to a callee that does almost nothing with it. The string originally came out of Web IDL bindings, and hence is an external stringbuffer-backed string. With our current setup, that causes a copy on the callee side, and copying a long string takes a while. The testcase outputs the average time per call, in ns. In an unmodified build I see times on the order of 600 us (600,000 ns) per call. With my changes I see times on the order of 100ns per call, at the iteration count in the testcase; it gets even faster (~30-40ns) with more iterations and better JIT-compilation.