On Fri, Jun 16, 2017 at 3:08 PM, Jan de Mooij <jdemo...@mozilla.com> wrote:
> I profiled this quickly and we're spending a lot of time in GC.

OK. So I accidentally created a string GC test instead of creating a
TextDecoder test. :-(

Is there a good cross-browser way to cause GC predictably outside the
timed benchmark section in order to count only the TextDecoder run in
the timing?

On Fri, Jun 16, 2017 at 3:41 PM, Jan de Mooij <jdemo...@mozilla.com> wrote:
> Also note that we have an external string cache (see
> ExternalStringCache::lookup), it compares either the char pointers or the
> actual characters (if length <= 100). If we are returning the same strings
> (same characters) all the time on this benchmark, you could try removing
> that length check to see if it makes a difference.

The length of the string is always well over 100, so that already
means that a string cache isn't interfering with the test, right?
(Interfering meaning making the test reflect something other that the
performance of the back end used by TextDecoder.)

On Fri, Jun 16, 2017 at 11:19 PM, Boris Zbarsky <bzbar...@mit.edu> wrote:
> On 6/16/17 7:22 AM, Henri Sivonen wrote:
>>
>> My hypothesis is that the JSC/WebKit overhead of returning a string
>> from C++ to JS is much lower than SpiderMonkey/Gecko overhead or the
>> V8/Blink overhead.
>
>
> It definitely is.  JSC and WebKit use the same exact refcounted strings,
> last I checked, so returning a string from WebKit to JSC involves a single
> non-atomic refcount increment.  It's super-fast.

Jan said "We create external strings (a JS string referencing a DOM
string buffer) for the strings returned from DOM to JS", so that means
Gecko does roughly the same in this case, right? Could it be that JSC
realizes that nothing holds onto the string and derefs it right away
without having to wait for an actual GC?

-- 
Henri Sivonen
hsivo...@hsivonen.fi
https://hsivonen.fi/
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to