Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Externalize templates to speed up build #459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mszabo-wikia
Copy link
Contributor

@mszabo-wikia mszabo-wikia commented Dec 19, 2024

Profiling the mcrouter OSS build with ninjatracing + clang's -ftime-trace indicates that a significant amount of time is spent in repeated template instantiations for ProxyConfig and ServiceInfo (see attached speedscope profile).

Add extern template declarations for these classes with their most common parameter (MemcacheRouterInfo) to reduce compile times. On a full build of mcrouter OSS with all tests, this reduces the build time from ~34 minutes to ~29 minutes.

@facebook-github-bot
Copy link
Contributor

@stuclar has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Profiling the mcrouter OSS build with ninjatracing + clang's
-ftime-trace indicates that a significant amount of time is spent in
repeated template instantiations for ProxyConfig and ServiceInfo
(see attached speedscope profile).

Add extern template declarations for these classes with their most
common parameter (MemcacheRouterInfo) to reduce compile times.
On a full build of mcrouter OSS with all tests, this reduces the build
time from ~34 minutes to ~29 minutes.
@mszabo-wikia
Copy link
Contributor Author

Updated to hopefully fix the linting error—clang-format inadvertently reformatted the srHostInfoPtrFuncRouteHandlesCommandDispatcher declaration as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants