Skip to content

Commit

Permalink
Noop for test GC pass when not in debug
Browse files Browse the repository at this point in the history
To get accurate metrics when load testing an optimized build, the GC pass
that is normally done per test is now disabled.
  • Loading branch information
Warfields committed Jun 20, 2023
1 parent a2fbc3d commit 952080d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/workerd/io/worker-entrypoint.c++
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ kj::Promise<WorkerInterface::CustomEvent::Result>
template <typename T>
void WorkerEntrypoint::maybeAddGcPassForTest(
IoContext& context, kj::Promise<T>& promise) {
#ifdef KJ_DEBUG
if (isPredictableModeForTest()) {
auto worker = kj::atomicAddRef(context.getWorker());
if constexpr (kj::isSameType<T, void>()) {
Expand All @@ -530,6 +531,7 @@ void WorkerEntrypoint::maybeAddGcPassForTest(
});
}
}
#endif
}

} // namespace workerd

0 comments on commit 952080d

Please # to comment.