You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
About a year ago @KaiBot3000, @aarthykc, and me put carmen under load, profiled with perf, and noticed a single, significant bottleneck in carmen-cache.
The bottleneck was the sorting of Context objects, specifically contextSortByRelev. This makes sense given Context objects are large (copying them is expensive), there may be a lot of them collected in memory, and the sort function is not simple.
After #93 we should see a slight speedup / reduction in the cost of this sorting because Context objects are now moved rather than copied. However I would not be surprised if the top bottleneck in carmen is still this sorting in carmen-cache. So this ticket stands to:
remind us that this is worthwhile of more investigation
document what we saw in case optimization work around sorting is picked up again
reference Ensure Context is noncopyable #93 which includes some ideas for optimizations not yet attempted, including using std::partial_sort
About a year ago @KaiBot3000, @aarthykc, and me put carmen under load, profiled with
perf, and noticed a single, significant bottleneck in carmen-cache.The bottleneck was the sorting of
Contextobjects, specificallycontextSortByRelev. This makes sense givenContextobjects are large (copying them is expensive), there may be a lot of them collected in memory, and the sort function is not simple.After #93 we should see a slight speedup / reduction in the cost of this sorting because
Contextobjects are now moved rather than copied. However I would not be surprised if the top bottleneck in carmen is still this sorting in carmen-cache. So this ticket stands to:std::partial_sortDetails:
carmen-cache/src/cpp_util.hpp
Lines 192 to 206 in dfa468a
carmen-cache/src/coalesce.cpp
Line 647 in dfa468a
perf. This is no surprise, sorting is expensiveperfoutput that previously highlighted sorting as the primary bottleneck: