From de64b753946034895bca74bc198b6090cb2d5bcc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 25 Apr 2015 06:15:15 -0700 Subject: 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. --- ChangeLog | 12 ++++++++++++ lib.c | 2 +- parser.y | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f98a6c5a..f7e68e10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2015-04-25 Kaz Kylheku + + 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 Regression: runaway allocation of heaps. diff --git a/lib.c b/lib.c index d7503294..03316881 100644 --- a/lib.c +++ b/lib.c @@ -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) diff --git a/parser.y b/parser.y index 071a090f..83d1b841 100644 --- a/parser.y +++ b/parser.y @@ -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) { -- cgit v1.2.3