On Wed, Dec 25, 2019 at 4:25 PM Richard Hipp <d...@sqlite.org> wrote:

>
> The video provided details on what they did.  I could not find any
> performance improvement by making mutexes direct calls instead of
> indirect calls.


This kind of optimization improves performance by reducing pressure on the
CPU's branch branch-target address caching and prediction.


> Maybe they are measuring performance differently than
> me.  (I use CPU cycle counts measured by valgrind.)
>

By default, valgrind doesn't model either branch predictors or
branch-target address caches.  Its model is somewhat primitive[0], but it
is available through command-line option `--branch-sim` [1,2].  When you
performance tested this change, did you enable that option?
tool/run-speed-test.sh certainly doesn't.

Of course, since those structures are shared globally, the performance
benefit for de-virtualizing any given function call is highly context
dependent.

Sincerely,
-- 
Jonathan Brandmeyer

[0]: https://valgrind.org/docs/manual/cg-manual.html#branch-sim
[1]:
https://www.valgrind.org/docs/manual/cl-manual.html#cl-manual.options.simulation
[2]: https://valgrind.org/docs/manual/cg-manual.html#cg-manual.cgopts
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to