diff options
author | Fred Drake <fdrake@acm.org> | 2003-04-08 15:40:44 +0000 |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2003-04-08 15:40:44 +0000 |
commit | bbdae5ca4ed6aca82d73a018bd0a61d92bf0d7e7 (patch) | |
tree | 8bc7381841dffdbdcec2067afe5228a87349d15b | |
parent | 4f400e9d2cce6fc9aad503e1f6e6c0fa438cf2bc (diff) | |
download | zope-tal-bbdae5ca4ed6aca82d73a018bd0a61d92bf0d7e7.tar.gz |
attrAction_tal(): Merge the commonest case of a short path through
attrAction() directly into attrAction_tal() to avoid a method
call. This is the most common path in the existing benchmarks,
and cuts out a lot of method calls.
-rw-r--r-- | talinterpreter.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/talinterpreter.py b/talinterpreter.py index b071274..ca8c44d 100644 --- a/talinterpreter.py +++ b/talinterpreter.py @@ -321,7 +321,13 @@ class TALInterpreter: def attrAction_tal(self, item): name, value, action = item[:3] if action in ('metal', 'tal', 'xmlns', 'i18n'): - return self.attrAction(item) + if not self.showtal: + # This shortcuts a common case that's also handled by + # the short path in .attrAction(); this avoids a + # method call that gets called too often. + return 0, name, value + else: + return self.attrAction(item) ok = 1 expr, xlat, msgid = item[3:] if self.html and name.lower() in BOOLEAN_HTML_ATTRS: |