Author: Maciej Fijalkowski <fij...@gmail.com> Branch: extradoc Changeset: r3949:5c778250e982 Date: 2011-10-27 17:36 +0200 http://bitbucket.org/pypy/extradoc/changeset/5c778250e982/
Log: add another para diff --git a/blog/draft/faster-json.rst b/blog/draft/faster-json.rst --- a/blog/draft/faster-json.rst +++ b/blog/draft/faster-json.rst @@ -89,6 +89,17 @@ methods for common infrastructure or loading globals (instead of rebinding as locals) is fast enough and improves code readability. +Copying is expensive +-------------------- + +If you use regular expressions replace, this would always copy a string as of +now. If you know your regexp is simple, first try to match it if there is +anything to replace in the first place. This is a pretty hard optimization to +do automatically -- simply matching the regular expression can be too costly +for it to make sense. In our particular example however, the regexp is really +simple, checking ranges of characters. It also seems that this is by far the +fastest way to escape characters as of now. + Generators are slower than they should be ----------------------------------------- _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit