Cache the fingerprint of sOpt_P
authorBartosz Nitka <niteria@gmail.com>
Thu, 22 Feb 2018 14:44:59 +0000 (06:44 -0800)
committerBartosz Nitka <niteria@gmail.com>
Fri, 2 Mar 2018 12:41:58 +0000 (04:41 -0800)
commitb8f03bbe16af7a09b494a33fbbe523ecd82f1a50
tree0455b9ccf3682e510fc957c92f45341df2c43b96
parent2756117bd26c2cb70d3f51954a88b7d7bdf3d3f2
Cache the fingerprint of sOpt_P

Before this change we would compute a hash of
all the command line -optP flags once per file.
With a lot of files and many -optP flags, that's a lot
of repeated work.

I added a new Note that explains the approach and rationale.

Test Plan: new test

Reviewers: simonmar, simonpj, bgamari

Reviewed By: simonpj

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14697

Differential Revision: https://phabricator.haskell.org/D4445
compiler/iface/FlagChecker.hs
compiler/main/DynFlags.hs
compiler/main/SysTools.hs
testsuite/tests/perf/compiler/all.T
testsuite/tests/perf/compiler/genT14697 [new file with mode: 0755]