Skip to content

Commit

Permalink
Reset callgrind stats after environment setup
Browse files Browse the repository at this point in the history
This makes sure we just measure parse+typeck+lint time.
  • Loading branch information
zeux committed Jul 5, 2022
1 parent 569f6e9 commit 67b4326
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CLI/Analyze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

#include "FileUtils.h"

#ifdef CALLGRIND
#include <valgrind/callgrind.h>
#endif

LUAU_FASTFLAG(DebugLuauTimeTracing)
LUAU_FASTFLAG(LuauTypeMismatchModuleNameResolution)

Expand Down Expand Up @@ -268,6 +272,10 @@ int main(int argc, char** argv)
Luau::registerBuiltinTypes(frontend.typeChecker);
Luau::freeze(frontend.typeChecker.globalTypes);

#ifdef CALLGRIND
CALLGRIND_ZERO_STATS;
#endif

std::vector<std::string> files = getSourceFiles(argc, argv);

int failed = 0;
Expand Down

0 comments on commit 67b4326

Please sign in to comment.