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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mcrouter/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ libmcroutercore_a_SOURCES = \
ProxyBase.h \
ProxyConfig-inl.h \
ProxyConfig.h \
ProxyConfig.cpp \
ProxyConfigBuilder.cpp \
ProxyConfigBuilder.h \
ProxyDestination.cpp \
Expand Down
3 changes: 3 additions & 0 deletions mcrouter/ProxyConfig-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "mcrouter/Proxy.h"
#include "mcrouter/lib/config/RouteHandleFactory.h"
#include "mcrouter/lib/fbi/cpp/util.h"
#include "mcrouter/lib/network/gen/MemcacheRouterInfo.h"
#include "mcrouter/routes/McRouteHandleProvider.h"
#include "mcrouter/routes/PrefixSelectorRoute.h"
#include "mcrouter/routes/ProxyRoute.h"
Expand All @@ -24,6 +25,8 @@ namespace facebook {
namespace memcache {
namespace mcrouter {

extern template class ProxyConfig<facebook::memcache::MemcacheRouterInfo>;

template <class RouterInfo>
ProxyConfig<RouterInfo>::ProxyConfig(
Proxy<RouterInfo>& proxy,
Expand Down
7 changes: 7 additions & 0 deletions mcrouter/ProxyConfig.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "mcrouter/ProxyConfig.h"
#include "mcrouter/ServiceInfo.h"
#include "mcrouter/lib/network/gen/MemcacheRouterInfo.h"

namespace facebook::memcache::mcrouter {
template class ProxyConfig<facebook::memcache::MemcacheRouterInfo>;
}
3 changes: 3 additions & 0 deletions mcrouter/ServiceInfo-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
namespace facebook {
namespace memcache {
namespace mcrouter {

extern template class ServiceInfo<facebook::memcache::MemcacheRouterInfo>;

namespace detail {

bool srHostInfoPtrFuncRouteHandlesCommandDispatcher(
Expand Down
9 changes: 6 additions & 3 deletions mcrouter/ServiceInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
#include "mcrouter/ServiceInfo.h"
#include "mcrouter/mcrouter_sr_deps.h"

namespace facebook::memcache::mcrouter::detail {
namespace facebook::memcache::mcrouter {

template class ServiceInfo<facebook::memcache::MemcacheRouterInfo>;

namespace detail {
bool srHostInfoPtrFuncRouteHandlesCommandDispatcher(
const HostInfoPtr& host,
std::string& tree,
Expand All @@ -23,5 +26,5 @@ bool srHostInfoPtrFuncRouteHandlesCommandDispatcher(
'\n');
return false;
}

} // namespace facebook::memcache::mcrouter::detail
} // namespace detail
} // namespace facebook::memcache::mcrouter