On 6/22/17 6:19 AM, Henri Sivonen wrote:
https://hsivonen.com/test/moz/encoding_bench_web/english-only.html

OK, so here's what I'm seeing on that benchmark, all numbers measured on Mac with a current nightly; other platforms may differ, etc. Profile at https://perf-html.io/public/f6a0a4a61edcd784b461d17ea3879c30e03ee7fb/calltree/?implementation=cpp&thread=2 for someone who wants to look themselves, but the numbers below are from an Instruments profile, because there I can do a much saner job of coalescing the various codepaths that lead to the functions of interest... [1]

Out of a total time of 7.6s or so on the main thread, 5.4s is under TextDecoderBinding::decode. 2.1s is under gcIfRequested. The remaining time, what there is of it, is almost all under various JS execution bits.

The time under gcIfRequested is almost all under sweeping/finalization. In fact, it's almost all under arena deallocation. I see 1.7s under huge_dalloc/chunk_dealloc (on Mac), with most of that (1.4s) being the madvise calls we make there and another 0.3s calling munmap. Depending on what it is we're freeing (the GC arenas themselves or the string data), either nursery allocation for external strings[2] or background finalization of external strings[3] would help here. The stacks look like we're freeing gc arenas, but it seems like there would be more freeing of the string data...

The time under TextDecoderBinding::decode is almost all (5.34s out of 5.4s) under encoding_rs::Decoder::decode_to_utf16 and in particular in encoding_rs::variant::VariantDecoder::decode_to_utf16_raw. That's all self time in there. I do see numbers that are much slower than Safari here, for what it's worth (about 2x), and the 25% of our time spent under gc is not nearly enough to account for the difference.

-Boris

[1] Not least because of https://github.com/devtools-html/perf.html/issues/388
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1375565
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=627220

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to