Raymond Hettinger <python@rcn.com>: > * Scanning my own sources, it looks like some of the builtins > almost never appear inside loops (dir, map, filter, zip, dict, range). > The ones that are in loops usually do something simple (int, str, > chr, len). Either way, builtin access never seems to dominate > the running time. OTOH, maybe that's just the way I write code. That's probably true in the large. However, sometimes one has a tight little loop that makes lots of calls to a builtin. I've occasionally improved the speed of something noticeably using the copy-a-builtin-to-a-local trick. Maybe for these cases there could be a "builtin" declaration, like "global" but declaring that something is to be found in the builtin scope? Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4