Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance question #13

Open
marceloverdijk opened this issue Apr 15, 2013 · 4 comments
Open

Performance question #13

marceloverdijk opened this issue Apr 15, 2013 · 4 comments

Comments

@marceloverdijk
Copy link

I don't know if this the right channel to ask this question, but as I could not find a dedicated forum I will do it anyway :-)

As I can read on the github page Silken is used in production.
I wonder if you did any benchmarking with the servlet container startup times?
The reason I'm asking is because the templates are compiled during startup, and there will be differences in compiling 1 templates or > 1000.
Especially if you are running on Google App Engine startup times are an important aspect as Google spawn and kills instances frequently.

Regards,
Marcel

@codedance
Copy link
Owner

Hi Marcel,

A fair question and this is as good a place as any to answer/answer. We (PaperCut) use Silken in production on Google App Engine. The startup time on an F1 instance (with a few other dependencies such as HtmlEasy) is around 9 seconds. A good way to get a feel is to play around with the ready-made GAE product for HtmlEasy (which includes Silken).

https://code.google.com/p/htmleasy/wiki/UsingHtmleasy

Adding extra templates will add startup/compile overhead, however most of the time is in the general servlet init. Once initialised compiling extra templates happens very quickly. I haven't done any benchmarks on 1000+ templates though.

I should also point out that you can configure Silken to compile the templates on startup (e.g. in a loading request), or on-demand (when the template is first requested). With some logical namespace separation you can also structure it so your popular templates are rendered on startup (e.g. warmup request), while the less popular ones are rendered on demand.

Hope this helps. Let me know your experiences.

Cheers,

Chris

@marceloverdijk
Copy link
Author

Hi Chris,

Thanks for reply. Would you be able to give some insight how many files/templates you compile at startup? This would be interesting to know.

I'm evaluating using Closure Templates in a Spring environment as alternative to JSP's.
Many concepts you used in Silken will probably be of interest for Spring/Closure Templates integration as well.

PS: 9s startup times are very nice. Using Spring gives me > 20s. An additional 10s for e.g. Closure Templates would not be a problem then...

@codedance
Copy link
Owner

You need to be careful with startup times on GAE, even if you're using warmup requests. A percentage of requests may hit unwarmed up instances. I've personally found Spring a little heavyweight for GAE. Internally we've used lighter weight solutions such as Guice and HtmlEasy/RestEasy.

I don't have any timing on template compile times. It's sparked my interest. I'll leave this tick open and when I get a spare moment I'll create a bunch of representative templates and see what timing we get.

@marceloverdijk
Copy link
Author

Hi @codedance,
Yes I know I have to be careful with startup times on GAE.
I did some tests in the past and even using resteasy (and guice) gave me startup times +10s. If I remember correctly between 12s and 15s.
Honestly for me there is no difference in startup time of 12s (e.g. resteasy) and Spring (30s). In both cases it's unacceptable :-)
But using plain servlets is also not really an option in terms of productivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants