Skip to content

Externalize templates to speed up build#459

Closed
mszabo-wikia wants to merge 1 commit intofacebook:mainfrom
mszabo-wikia:optimize-build-times
Closed

Externalize templates to speed up build#459
mszabo-wikia wants to merge 1 commit intofacebook:mainfrom
mszabo-wikia:optimize-build-times

Conversation

@mszabo-wikia
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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