RazorEngine 3.4.1.0 Slow in AWS EC2
My group is using RazorEngine to generate various web pages. One such template is ~200 KB in size. Has around 60 token entries to be substituted. No actual Razor/C# logic in the template that I can see. We are using the following call:
returnContent = Razor.Parse(content, model, cacheKey);
The problem is on an AWS server running Windows 2008 R2 it takes around 20 seconds to parse the page. I even broke the call down into Razor.Compile and Razor.Run. The 20 seconds came from Razor.Run. The AWS instance is decent in size (c3.xlarge). Nothing running on it that seems to be taking up CPU or memory.
If I remove all the @ symbols except one then the parsing goes down to less than 1 second.
The kicker is when I execute this same code and template, with the 60 token references, on my laptop under VS 2012 it returns in less than a second.
Any ideas on why RazorEngine is taking so long on the server? Thanks.
Ignore this question. We were inadvertently resetting the TemplateService in each incoming call. This cause the templates to be re-compiled on every call.
链接地址: http://www.djcxy.com/p/65102.html