[Play-Java 2.4.x] Why play framework is so slow when using twirl?

89 views
Skip to first unread message

Saeed Zarinfam

unread,
Feb 7, 2016, 9:13:02 AM2/7/16
to play-framework
I have a controller, when i render a twirl template and return it in my action. the play performance decrease about 5 time (15000 Requests per second in apache benchmark). but when i return json in this action play performance increase about 5 time  (79000 Requests per second in apache benchmark). I have a very simple twirl template:

@(message: String)

@main("Welcome to Play") {

@message

}

Rich Dougherty

unread,
Feb 9, 2016, 2:27:17 AM2/9/16
to play-framework
I can imagine there are times when JSON is slower than Twirl, it depends on the JSON and on the Twirl template code, on the size of the JSON vs the size of the HTML, etc. You probably need to do some experiments to understand what's causing performance issues, e.g. write a minimal, no data JSON result and a minimal, no data Twirl template and compare performance, run in a profiler, etc.

– Rich

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/e29c9cd5-3dca-4fbb-89b9-2b37f0555a6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Rich Dougherty
Engineer, Typesafe, Inc
Reply all
Reply to author
Forward
0 new messages