From 1732ddec4d34863bb4396444acd85f3c746961db Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Mon, 21 May 2018 09:22:49 -0700 Subject: [PATCH] Disable the parser cache I wasn't able to observe a meaningful performance improvement from it, and it requires some file I/O. Here are the times, in seconds, I observed on my ThinkPad T450s with Python 3.6 and Ubuntu 18.04: test 1 test 2 master 8.96 2.59 this change 8.88 2.62 Test 1 is the total time from: $ time dash -c 'git clean -dfx && pip install -e . && pytest --ignore tests/test_bin.py' Test 2 is pytest's reported total time from a subsequent: $ pytest --ignore tests/test_bin.py --- hy/lex/parser.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hy/lex/parser.py b/hy/lex/parser.py index 236b825..fac2577 100755 --- a/hy/lex/parser.py +++ b/hy/lex/parser.py @@ -17,10 +17,7 @@ from .lexer import lexer from .exceptions import LexException, PrematureEndOfInput -pg = ParserGenerator( - [rule.name for rule in lexer.rules] + ['$end'], - cache_id="hy_parser" -) +pg = ParserGenerator([rule.name for rule in lexer.rules] + ['$end']) mangle_delim = 'X'