Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize pr-str by making more use of StringBuffer.
Previously, a huge number of temporary vectors and lazy sequences were built up and concat-ed, which ran reasonably on newer JS engines (e.g. V8) but suffered from miserable performance on old engines (such as IE8). By passing a StringBuffer down the callstack and appending to that, performance gains of 10-100X can be seen in older JS engines. For backwards compatibility, the new fastpath uses a new IPrintWithWriter protocol, and the old IPrintable is left in place. The old protocol is used as a fallback for items that do not satisfy IPrintWithWriter.
- Loading branch information
Evan Mezeske
authored and
David Nolen
committed
Sep 5, 2012
1 parent
b8fcdf0
commit c8bc05c
Showing
3 changed files
with
333 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.