forked from GitHub/gf-core
Profiling showed that when loading a large .gfo file, shareString was responsible for 15-18% of the CPU time, and a lot of the allocation. Since we already use ByteStrings for reading the source files, shareString mostly has the effect of creating lots of small ByteStrings instead of one large one. Since the plain size of the .gfo is seldom a problem (unlike when it was read as a String), it is ok to keep the whole file as one ByteString in RAM, and have all tokens point into that. Profiling after the change showed 15-20% reduction in CPU time and in total allocation.
8 lines
256 B
Makefile
8 lines
256 B
Makefile
all:
|
|
cd ../.. && bnfc -p GF.Source -bytestrings GF/Source/GF.cf
|
|
rm ErrM.hs
|
|
perl -i -pe 's/%name pModHeader ModHeader/%partial pModHeader ModHeader/' ParGF.y
|
|
perl -i -pe 's/GF.Source.ErrM/GF.Data.ErrM/' *.hs *.x *.y
|
|
happy -gca ParGF.y
|
|
alex -g LexGF.x
|