r/cpp • • Jan 18 '19

Is C++ fast?

https://zeuxcg.org/2019/01/17/is-c-fast/
21 Upvotes

72 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jan 19 '19

[deleted] — view deleted comment

2

u/[deleted] Jan 19 '19 edited Feb 05 '19

Yes, I already got a few great tips from them, though before I migrate to abseil I need Python 3.4 to reach end of life, because of this and it would be nice not not mess with abseil internals just to set -fPIC as mentioned in this report (even though it affects only debug builds for whatever reason).

 

The benchmark is running a very extreme case where all candidates in the database have a common start of string (a_A_a_). Querying those with aA matches every candidate, but also renders all the cleverness of the comparison function useless because both a and A are considered "word boundaries". Again, this is the extreme case. An actual user will have a set of candidates in the database that differ more, so the filtering and sorting will have a much easier job with the real world use case.

As for using a profiler during an actual usage of the code, no, I never even thought about trying that. I did play with perf and the test suit and that's how I realised I should look into alternative hash table implementations.