diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-04-25 06:15:15 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-04-25 06:15:15 -0700 |
commit | de64b753946034895bca74bc198b6090cb2d5bcc (patch) | |
tree | f8ebbea3de417c1c9efcbe50914d70ced2363368 | |
parent | 097b3d2421b040e9e8512275c7c64f19c16615be (diff) | |
download | txr-de64b753946034895bca74bc198b6090cb2d5bcc.tar.gz txr-de64b753946034895bca74bc198b6090cb2d5bcc.tar.bz2 txr-de64b753946034895bca74bc198b6090cb2d5bcc.zip |
Remove silly package lookup from keywordp.
This tiny change yields a 165% (2.65X) speedup in the
tst/tests/011/mandel.txr test case.
* lib.c (keywordp): Use keyword_package_var instead of the
keyword_package macro which looks up the global environment.
* parser.y (sym_helper): Likewise.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | lib.c | 2 | ||||
-rw-r--r-- | parser.y | 2 |
3 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,15 @@ +2015-04-25 Kaz Kylheku <kaz@kylheku.com> + + Remove silly package lookup from keywordp. + + This tiny change yields a 165% (2.65X) speedup in the + tst/tests/011/mandel.txr test case. + + * lib.c (keywordp): Use keyword_package_var instead of the + keyword_package macro which looks up the global environment. + + * parser.y (sym_helper): Likewise. + 2015-04-24 Kaz Kylheku <kaz@kylheku.com> Regression: runaway allocation of heaps. @@ -3639,7 +3639,7 @@ val symbolp(val sym) val keywordp(val sym) { - return (symbolp(sym) && symbol_package(sym) == keyword_package) ? t : nil; + return c_true(sym && symbolp(sym) && sym->s.package == keyword_package_var); } loc get_user_package(void) @@ -1041,7 +1041,7 @@ static val sym_helper(scanner_t *scnr, wchar_t *lexeme, val meta_allowed) *colon = 0; if (colon == lexeme) { - package = keyword_package; + package = keyword_package_var; sym_name = string(colon + 1); free(tokfree); } else if (colon != 0) { |