AngelDoReMi / closure-templates

Automatically exported from code.google.com/p/closure-templates
Apache License 2.0
0 stars 0 forks source link

Exceptions raised within Soy compiler should not fill out the stack trace #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compile soy templates while running a profiler.

What is the expected output? What do you see instead?
It should spend most of it's time waiting on IO. Instead, it spends a large 
portion of it's time (over 50% in my test application) raising IOExceptions and 
Errors.

Please provide any additional information below.
The compiled output of JavaCC raises IOExceptions in the generated file 
com.google.template.soy.exprparse.SimpleCharStream for dealing with EOF. 
Creation of these are expensive, particularly in deep call trees, due to 
filling out the stack trace. If we used a different Exception here that didn't 
fill in the stack trace, it would be much faster.

Similarly, the generated LookaheadSuccess inner class within 
com.google.template.soy.exprparse.ExpressionParser is raised a large number of 
times per parse, and each fills in the stack trace. It should override the 
fillInStackTrace method and do nothing when this is called.

Original issue reported on code.google.com by ian.grun...@gmail.com on 7 Aug 2012 at 12:43

GoogleCodeExporter commented 8 years ago
Version r22. This may be fixed in a later version?

Original comment by ian.grun...@gmail.com on 7 Aug 2012 at 12:45

GoogleCodeExporter commented 8 years ago
Closure Templates has migrated to GitHub, 
https://gitub.com/google/closure-templates. Please reopen this there if it's 
still an issue.

(I've also been working on improving error handling within Soy. See 
https://github.com/google/closure-templates/commit/e2f68f96746e71cd01329cc3aaccc
149cd9be0bc for example.)

Original comment by brendan....@gmail.com on 27 Feb 2015 at 12:03