lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] std::unordered_map vs std::map


From: Vadim Zeitlin
Subject: Re: [lmi] std::unordered_map vs std::map
Date: Sat, 6 Oct 2018 23:32:26 +0200

On Sat, 6 Oct 2018 21:13:42 +0000 Greg Chicares <address@hidden> wrote:

GC> Interestingly, I see virtually no performance difference in
GC>   $make $coefficiency unit_tests unit_test_targets=ledger_test.exe |grep 
evalu  
GC>   make_evaluator() : 1.572e-001 s mean;     150181 us least of   7 runs
GC> if I
GC>   %s/unordered_//g
GC> as in the patch below. My measurements:
GC>   150 ms std::map
GC>   148 ms std::unordered_map

 For once I can't say that the benchmarking results are really surprising
as I wouldn't expect map lookup time to be a big part of overall time here.
I.e. if the difference is really 2ms (although IME this is well inside the
margin of error), it might still be pretty significant if the total time
spent in map lookup code is, say, 5ms.

 Of course, as usual, only really profiling the code would tell for sure.
As you know, I plan to do it anyhow and I could check the difference
between profiling results with and without this patch too when doing it.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]