diff --git a/TODO b/TODO index d4824cc6..fc007c98 100644 --- a/TODO +++ b/TODO @@ -10,6 +10,8 @@ Before Release: * Cache environment variables * Remove coverage cases for things that are heavily exercised or are in critical paths +* Make ./performance_check usable by other people by having published + files to use for testing. * Evaluate issues tagged with `next` * Stay on top of https://github.com/pikepdf/pikepdf/pull/315 diff --git a/libqpdf/QTC.cc b/libqpdf/QTC.cc index d27bfa8b..21d240ba 100644 --- a/libqpdf/QTC.cc +++ b/libqpdf/QTC.cc @@ -2,6 +2,7 @@ #include #include +#include #include static bool @@ -14,12 +15,19 @@ tc_active(char const* const scope) void QTC::TC(char const* const scope, char const* const ccase, int n) { - static std::set> cache; + static std::map active; + auto is_active = active.find(scope); + if (is_active == active.end()) { + active[scope] = tc_active(scope); + is_active = active.find(scope); + } - if (!tc_active(scope)) { + if (!is_active->second) { return; } + static std::set> cache; + std::string filename; #ifdef _WIN32 # define TC_ENV "TC_WIN_FILENAME"