From 24c68069948681366ff2351dd7400af6e69006d9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 11 Jun 2018 16:06:01 +0200 Subject: Cache parse trees This prevents EvalState::resetFileCache() from parsing everything all over again. --- src/libexpr/eval.hh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libexpr/eval.hh') diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 146f212550..d0f298e168 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -90,6 +90,14 @@ public: private: SrcToStore srcToStore; + /* A cache from path names to parse trees. */ +#if HAVE_BOEHMGC + typedef std::map, traceable_allocator > > FileParseCache; +#else + typedef std::map FileParseCache; +#endif + FileParseCache fileParseCache; + /* A cache from path names to values. */ #if HAVE_BOEHMGC typedef std::map, traceable_allocator > > FileEvalCache; -- cgit 1.4.1