Performance tests for tcmalloc enabled/disabled on Linux

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Performance tests for tcmalloc enabled/disabled on Linux

Postby Czarek » Sun Feb 09, 2014 5:49 pm

Hi there,

I've been doing some performance tests with tcmalloc global hook enabled and disabled. This hook is causing problems in cefpython when including third party libraries. It requires that the cefpython library must be the very first library imported. If for example wxWidgets is imported before CEF, then you will be getting random unrelated segmentation faults all over your app. See this topic for more details: viewtopic.php?f=6&t=10850 .

At first I was astonished that tcmalloc was so much faster in CEF js tests. But later when running real browser tests at peacekeeper.futuremark.com it turns out that tcmalloc is a few percentages slower.

In CEF javascript test 1 that tests creation of cef v8 types (int, bool, string), tcmalloc is faster by about 30-40%. In javascript test 2 which tests speed of function execution with different types returned, tcmalloc doesn't make much difference, sometimes it is a bit faster sometimes a bit slower.

See comparison table of javascript test 1:
https://docs.google.com/document/d/1ykl ... edit?pli=1

Javascript tests 1 and 2 for tcmalloc enabled:
https://docs.google.com/document/d/1SuE ... edit?pli=1

Javascript tests 1 and 2 for tcmalloc disabled:
https://docs.google.com/document/d/1R03 ... OqCAE/edit

It looks better when running real browser test at peacekeeper.futuremark.com. The version with tcmalloc disabled is faster by 2.3% (4804 tcmalloc disabled vs 4695 tcmalloc enabled).

See full details:
https://docs.google.com/document/d/1_X2 ... sp=sharing

Testing Chrome 33 CEF3 branch 1750 revision 1604, running on Ubuntu 12.04.3 64-bit.
Processor: i7-3632qm 4 cores 8 threads.

Why is there so much speed degradation with tcmalloc disabled in CEF javascript test 1?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Performance tests for tcmalloc enabled/disabled on Linux

Postby fddima » Mon Feb 10, 2014 7:43 am

Hi!

At first I was astonished that tcmalloc was so much faster in CEF js tests. But later when running real browser tests at peacekeeper.futuremark.com it turns out that tcmalloc is a few percentages slower.


Why is there so much speed degradation with tcmalloc disabled in CEF javascript test 1?


This js-perf tests in fact should be named like V8 bindings/interop/marshalling performance. They are measuring how many calls can be done from JS to CEF side, including any costs of wrapping V8 values in CefV8Value. So, 'cause this tasks are rely on new/delete operators, - it highly depends on allocator (and you can see difference).

Any 'real-world' test suites, should measure something other - JS performance / DOM performance / etc.

But in V8 is probably very hard to see allocator's difference, 'cause V8 heap mostly did not used for simple values, V8 handles are allocated on pre-allocated blocks (to reduce number of allocator calls), and i think many other optimizations (probably V8 heap also did not use classic allocation, but i'm not sure).
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Performance tests for tcmalloc enabled/disabled on Linux

Postby Czarek » Mon Feb 10, 2014 10:06 am

Hi Dmitry,

Thanks for the explanation of CEF V8/JS tests. It's clear now.

On a side note, tcmalloc hook is enabled only on Linux. On Windows it is disabled. Not sure about Mac.

Best regards.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 22 guests