[Andrew M. Kuchling] > ... > Friedl's book describes several optimizations which aren't implemented > in PCRE. The problem is that PCRE never builds a parse tree, and > parse trees are easy to analyse recursively. Instead, PCRE's > functions actually look at the compiled byte codes (for example, look > at find_firstchar or is_anchored in pypcre.c), but this makes analysis > functions hard to write, and rearranging the code near-impossible. This is wonderfully & ironically Pythonic. That is, the Python compiler itself goes straight to byte code, and the optimization that's done works at the latter low level. Luckily <wink>, very little optimization is attempted, and what's there only replaces one bytecode with another of the same length. If it tried to do more, it would have to rearrange the code ... the-more-things-differ-the-more-things-don't-ly y'rs - tim
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