New issue
Advanced search Search tips

Issue 890895 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Oct 12
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Calling custom inlined function was significantly faster than using base::EraseIf

Project Member Reported by jmad...@chromium.org, Oct 1

Issue description

I was investigating a perf regression with the passthrough command buffer. I ended up coding a solution implemented in http://crrev.com/c/1247941 . During implementation of my solution I found:

a) calling base::EraseIf was slower than calling std::erase/std::remove_if.
b) forcing ALWAYS_INLINE on base::EraseIf seemed to improve things.
c) writing a custom iterating deleter over a std::vector was faster than inlined base::EraseIf or the inlined std::erase/std::remove_if. (~5% improved score)

It does seem like Clang can be reluctant to inline functions at times. Using ALWAYS_INLINE does always work. Otherwise it may decide not to inline functions even if marked inline.

Also there could be potentially some slowness in the STL functions for iterate-based erase. dcheng assigning to you for triage. I can provide more info on my experiments if needed. Not sure what components to use for this issue.
 
Cc: thakis@chromium.org
Which platform did you measure this on?
Windows / x64 / official build.
Windows generally builds with "optimize for size" than "optimize for speed", except for some high-impact targets that opt for larger code size in return for higher speed (https://cs.chromium.org/search/?q=optimize_max+file:%5C.gn&sq=package:chromium&type=cs). 

So maybe this is all working as intended?
Status: WontFix (was: Assigned)
OK, let's leave things as-is. In general, optimizing for size is probably the right thing to do, and if certain places really need the speed, they can always manually inline.

Sign in to add a comment