[2.0] Performance issues compared to 1.2.3. Is 2.0 slower?

3,088 views
Skip to first unread message

Simon

unread,
Mar 14, 2012, 8:02:30 AM3/14/12
to play-fr...@googlegroups.com
I wanted to move to play 2 scala from play 1.2.3 java. I implemented the same template in play 1.2.3 and 2.0 to test it out, the 2.0 version was noticeably slower. Loading static files was also quite slow. I have about 20 odd files in the public directory and they load about 10x slower.

In each case I created the project from the play command. I used apache benchmark running it on my local to get the following results. Any one have any ideas on how I can increase performance in dev mode? I'm a bit hesitant to upgrade if I can't get the performance increases people are talking about?

On a template generated file with the command ab -c 100 -n 100 I get:

[1.2.3] = 49.26 requests per second
[2.0]    = 38.36 requests per second

On a static JS file (jquery-1.7.1.min.js) I get:

[1.2.3] = 247.51 requests per second
[2.0]    = 21.21  requests per second


GrailsDeveloper

unread,
Mar 14, 2012, 10:48:11 AM3/14/12
to play-fr...@googlegroups.com
Dev or prod-mode?

sun

unread,
Mar 14, 2012, 2:35:03 PM3/14/12
to play-framework
>Any one have any ideas on how I can increase performance in dev mode?
Buy an SSD disk. Turnaround times in dev mode are very slow with Scala
but in production it performs fine.

Leone

unread,
Mar 14, 2012, 3:23:04 PM3/14/12
to play-framework
I'm facing the same problem. Compiling time in Scala is 2 times slower
than java.

Simon

unread,
Mar 14, 2012, 4:24:23 PM3/14/12
to play-fr...@googlegroups.com
I have an SSD drive :) ....... The Java version of Play 2 is also just as slow... DEV mode really needs to improve as I would imagine it would affect a lot of developers and their development times.

Simon

unread,
Mar 14, 2012, 4:27:37 PM3/14/12
to play-fr...@googlegroups.com
From my figures I think this its something like 10X slower as compared to 1.X versions.

Anyone know if this is being looked at? If you're not as patient as me I would think a lot of DEVs might get really peeved and not use play 2.0.

Olivier Refalo

unread,
Mar 14, 2012, 4:33:04 PM3/14/12
to play-fr...@googlegroups.com
Interesting, I don't recall having speed issues - I code in Java

You could maybe share your project so we can have a better idea.

peter hausel

unread,
Mar 14, 2012, 5:54:03 PM3/14/12
to play-fr...@googlegroups.com
Hi Simon, The dev mode was meant to be used by a single developer while building an app. There is no point in running ab benchmarks against it. As for why 1.2.3 dev mode might be faster in certain situations: play 2.0 compiles and watches more components which might explain the difference.

Rest assured, we are going to keep improving the overall performance (and depending which version of play2 you are on, you might already see some improvements).

Hope this helps.

Thanks,
Peter

Simon

unread,
Mar 14, 2012, 6:24:46 PM3/14/12
to play-fr...@googlegroups.com
Hi Peter,

Now that I've had my tea and a good nights sleep. The issue is not so big. I really enjoy programming with the play framework and I am very happy with what the team has done with play 2.0

To demo the issue though and to help show what I have experienced I have attached my test that I have created. The two projects in the zip are the same but one is play 1.2.3 and the other is play 2.0_scala . My concern really is in the serving of STATIC content like JS files. My example is a bit extreme but is a realistic and plausible one.

Serving static files takes about 10ms with play 1.2.3 and about 300ms with play 2.0. I have an SSD drive so it will be quite a bit slower on a normal HDD.

All in all it could take up to 5-10 seconds to load a page as opposed to 1-2 seconds in play 1.2.3 in the example.

This however is in DEV mode and only affects development. Anything that can be done to improve this would be great.

Thanks,
Simon
SpeedTests.zip

sas

unread,
Mar 14, 2012, 11:05:25 PM3/14/12
to play-framework
Hi

I'm talking out of ignorance, but I wonder if the same behaviour is
present in dev mode using groovy templates (or japid or any other
option, when they become available)
I mean, if you don't use scala templates, the scala compiler shoudn't
be used at all... am I right?
>  SpeedTests.zip
> 779 KVerDescargar

Ben McCann

unread,
Mar 15, 2012, 12:10:43 AM3/15/12
to play-fr...@googlegroups.com
The routes are still in Scala.  However, I think if someone could make a Java version of routes it would save us from the slow Scala compile times that we're stuck with now.

冉兵

unread,
Mar 15, 2012, 12:42:54 AM3/15/12
to play-fr...@googlegroups.com
Since you mentioned it. 

I don't have immediate plan to make a Japid port to Play2 (or ScalaPlay 1.0 precisely), since I don't see any benefit of using it in a mostly Scala based architecture (Admittedly I'm not keen on using Scala in a team of more than a couple of members). In a medium-sized project, my team of about 15 developers have been enjoying really fast and hassle free change-reloading cycle in dev time with 1.2.x of Play/Japid, ranging from an eye-blink for small changes and less than 10 secs for big changes. I don't see that happening in Play 2. I'm hesitating to do something that my team won't be using any time soon, since it's irresponsible to roll it out knowing it won't get much field testing in my own team.

Bing


2012/3/15 sas <ope...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.


Ben McCann

unread,
Mar 15, 2012, 12:56:12 AM3/15/12
to play-fr...@googlegroups.com
Development speeds should increase greatly if Japid were available.  The problem today is that it takes a very long time to compile all the views since they are written in Scala.  If we could write the views in Java then reloads would be far faster since we could create projects with almost no scala (the routes being an exception, but that's only one or two files which change much less frequently and thus do not need to be recompiled as often).  While much of the framework itself is written in Scala, that luckily doesn't matter since it does not need to be recompiled during development.  I think Japid would get much more adoption with Play 2 because the benefit it would provide would be so much greater.

-Ben

冉兵

unread,
Mar 15, 2012, 1:44:18 AM3/15/12
to play-fr...@googlegroups.com
Hi,

I briefly poked around in the Play2 code some time ago. I understand that the role Scala plays in the Play2. 

Play1 has its issues but I don't think going Scala is the (only) way out. My Scala is not nearly as fluent as my Java and I don't believe the language complexity, the liberal coding style and code structure, the runtime layout and footprint, and the lack of the compiler performance would be compensated by the power it brings, for developers of average skill, me counted. For average new guys approaching Play with no language discrimination, I'd still recommend Play 1 over 2, and that's what I'm doing for my team.

The Japid adoption rate does not concern me at all. I'd be happy to dump it if something better comes along. In fact I'll consider it as a competitive edge if my competitors are using Play without it. As a CEO of a small startup in the fast moving Chinese market, I have a more important business side to take care of than chasing the latest framework. 

That pretty much summaries my stance toward Japid and Play2.

Bing
 

2012/3/15 Ben McCann <b...@benmccann.com>

Simon

unread,
Mar 15, 2012, 1:49:14 AM3/15/12
to play-fr...@googlegroups.com
Having to program in one language for both templates and back end logic is much easier, which I would imagine is the point of using scala but the performance is a bummer.

But what about the basics of loading files like javascript, css and image files. My simple test gave me a 10X slowdown in loading those. Which I find is really odd considering there should be no compiling of those whatsoever. 


2012/3/15 sas <ope...@gmail.com>
To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

Ben McCann

unread,
Mar 15, 2012, 1:49:33 AM3/15/12
to play-fr...@googlegroups.com
Yes, I agree completely on your views of Java vs Scala.  Luckily I've not had to create a single .scala file in my Play 2 project (there are some that are autogenerated and then compiled, but I myself never have to touch it).  Play 2 has many other nice features that made it much nicer than Play 1 for me.  E.g. the biggest win is that I do not need to have Play installed on the machines where I run my servers.  Play 2's "play dist" means that I can create a distribution which I then deploy and run using fabfile having to never install or upgrade Play on any of those servers.

Kurniawan Atharwa

unread,
Mar 15, 2012, 3:16:43 AM3/15/12
to play-fr...@googlegroups.com
> --
> You received this message because you are subscribed to the Google
> Groups "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/bspsFb0Jjc8J.

> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.
My issue here is using play 2.0 is slower than play 1.x while compiling
files.

Manuel Bernhardt

unread,
Mar 15, 2012, 3:32:00 AM3/15/12
to play-fr...@googlegroups.com
On Thu, Mar 15, 2012 at 4:05 AM, sas <ope...@gmail.com> wrote:
> Hi
>
> I'm talking out of ignorance, but I wonder if the same behaviour is
> present in dev mode using groovy templates (or japid or any other
> option, when they become available)
> I mean, if you don't use scala templates, the scala compiler shoudn't
> be used at all... am I right?

I think the main issue is not the compilation time, but the time it
takes to reload the application after a classloader drop. This is
noticeable enough to be annoying.

Indeed, changing a Groovy template doesn't lead to re-compilation &
classloader change, so it is pretty fast.


Regarding the loading time of static assets, this reminds me of a bug
in RC-2...I don't find the assets loading in Play 2 slow at all.

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.

GrailsDeveloper

unread,
Mar 15, 2012, 3:34:21 AM3/15/12
to play-fr...@googlegroups.com
Perhaps Rythm can be fill this gap. There was some discussion to change it so that it will be more compiler safe.

Niels

green

unread,
Mar 15, 2012, 5:38:08 AM3/15/12
to play-fr...@googlegroups.com
I prefer to sacrifice a little bit type safety when passing parameters to templates and take the benefit of dynamic coding. Specifically I love playone's passing template arguments by variable name, and also the concept of implicit renderArgs. 

There is at the moment no plan to make Rythm be "more" type safe but I think it should doable to create a play2 plugin based on it just as what Mr. Morten did for "Faster Groovy Templates". However I am not a good person for this task because I am neither scalar nor play2 person. I welcome some play2 guru to porting it to play2 and would be happy to provide any support if needed.

Green

To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/KX-7agj2_rsJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

Manuel Bernhardt

unread,
Mar 15, 2012, 6:10:41 AM3/15/12
to play-fr...@googlegroups.com
> There is at the moment no plan to make Rythm be "more" type safe but I think
> it should doable to create a play2 plugin based on it just as what Mr.
> Morten did for "Faster Groovy Templates". However I am not a good person for
> this task because I am neither scalar nor play2 person. I welcome some play2
> guru to porting it to play2 and would be happy to provide any support if
> needed.

For Groovy templates, you could give this one a try:
https://github.com/manuelbernhardt/play2-groovy-templates

We've been using it for a bit now, so most bugs should be gone by now.

Manuel

>>>>>> To post to this group, send email to play-fr...@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to
>>>>>> play-framewor...@googlegroups.com.
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/play-framework?hl=en.
>>>>>>
>>>>>

>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "play-framework" group.

>>>>> To post to this group, send email to play-fr...@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> play-framewor...@googlegroups.com.
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/play-framework?hl=en.
>>>>
>>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "play-framework" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/play-framework/-/KX-7agj2_rsJ.
>>
>> To post to this group, send email to play-fr...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> play-framewor...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/play-framework?hl=en.
>
>

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.

Morten Kjetland

unread,
Mar 15, 2012, 7:10:35 AM3/15/12
to play-fr...@googlegroups.com
I have to plug my implementation of groovy templates for play 2 as well then :)

https://github.com/mbknor/gt-engine-play2

This plugin/module uses the same implementation as the play 1 module
"Faster groovy Templates" (Fastergt)

We should seriously have a list somewhere which can contain all such
modules/addons for play 2.

-morten

sas

unread,
Mar 15, 2012, 7:12:48 AM3/15/12
to play-framework
fortunatelly play 2 has a more modular structure, so if the problem
seems to be scala compilation times in dev mode, I'm sure there will
appear a java only template solution (we already have groovy support)

It would be nice to know if the performance problems with static files
is the expected behavior or it's just a bug that shall be addressed in
future releases.

On the other hand, I'm pretty sure that play devs will improve the
performance of the framework in future releases, just like peter
hausel said

saludos

sas

sun

unread,
Mar 15, 2012, 7:19:30 AM3/15/12
to play-framework
@Ben: Does fabfile transfer only the transfer the changed portions of
the distribution zip file?

The zip file generated by play dist is over 50MB for my app. I gave up
uploading it with scp as it is too slow and I update my app many times
a day. So I switched back to version control (vc) push/pull. I would
love to ban vc from my production machine but I need to find first a
transport way that only transfers the changed portions.

Pascal Voitot Dev

unread,
Mar 15, 2012, 7:22:39 AM3/15/12
to play-fr...@googlegroups.com
During last 6 months, I've seen Scala compiler speed increase quite a lot in SBT/Eclipse/IDEA for ex.
I don't see why it wouldn't go on getting faster in the next months as Scala is getting more audience and support.


--
You received this message because you are subscribed to the Google Groups "play-framework" group.

Manuel Bernhardt

unread,
Mar 15, 2012, 9:07:00 AM3/15/12
to play-fr...@googlegroups.com
> We should seriously have a list somewhere which can contain all such
> modules/addons for play 2.

+1 on that. There may not be too many of those modules around yet but
I suppose that will change.

Guillaume Bort

unread,
Mar 15, 2012, 10:57:27 AM3/15/12
to play-fr...@googlegroups.com
>> We should seriously have a list somewhere which can contain all such
>> modules/addons for play 2.

yes, we seriously need to rebuild the whole (crappy) modules page on
the website. In the meantime someone should open a page on the wiki.

On Thu, Mar 15, 2012 at 6:07 AM, Manuel Bernhardt

--
Guillaume Bort

Manuel Bernhardt

unread,
Mar 15, 2012, 12:21:32 PM3/15/12
to play-fr...@googlegroups.com
https://github.com/playframework/Play20/wiki/Modules

Morten, I hope the naming is right.

Cheers,

Manuel

peter hausel

unread,
Mar 15, 2012, 12:47:59 PM3/15/12
to play-fr...@googlegroups.com
excellent - I added our plugins. Thanks!

>>>>>>>>>> To post to this group, send email to play-framework@googlegroups.com.


>>>>>>>>>> To unsubscribe from this group, send email to

>>>>>>>>>> play-framework+unsubscribe@googlegroups.com.


>>>>>>>>>> For more options, visit this group at
>>>>>>>>>> http://groups.google.com/group/play-framework?hl=en.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>> Groups "play-framework" group.

>>>>>>>>> To post to this group, send email to play-framework@googlegroups.com.


>>>>>>>>> To unsubscribe from this group, send email to

>>>>>>>>> play-framework+unsubscribe@googlegroups.com.


>>>>>>>>> For more options, visit this group at
>>>>>>>>> http://groups.google.com/group/play-framework?hl=en.
>>>>>>>>
>>>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google Groups
>>>>>> "play-framework" group.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msg/play-framework/-/KX-7agj2_rsJ.
>>>>>>

>>>>>> To post to this group, send email to play-framework@googlegroups.com.


>>>>>> To unsubscribe from this group, send email to

>>>>>> play-framework+unsubscribe@googlegroups.com.


>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/play-framework?hl=en.
>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google Groups
>>>>> "play-framework" group.

>>>>> To post to this group, send email to play-framework@googlegroups.com.


>>>>> To unsubscribe from this group, send email to

>>>>> play-framework+unsubscribe@googlegroups.com.


>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/play-framework?hl=en.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups "play-framework" group.

>>>> To post to this group, send email to play-framework@googlegroups.com.
>>>> To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.


>>>> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "play-framework" group.

>>> To post to this group, send email to play-framework@googlegroups.com.
>>> To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.


>>> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "play-framework" group.

>> To post to this group, send email to play-framework@googlegroups.com.
>> To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.


>> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>>
>
>
>
> --
> Guillaume Bort
>
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.

> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

Ben McCann

unread,
Mar 15, 2012, 1:16:01 PM3/15/12
to play-fr...@googlegroups.com
Sun, yes fabfile only transfers the changed portion of the distribution.  You just need to call rsync_project.


To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/MJvHn7eGBrcJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

Morten Kjetland

unread,
Mar 15, 2012, 1:19:46 PM3/15/12
to play-fr...@googlegroups.com
super.

I'll check it out and modify it if needed.

thanks!

-morten

>>> >>>>>>>>>> play-fr...@googlegroups.com.
>>> >>>>>>>>>> To unsubscribe from this group, send email to
>>> >>>>>>>>>> play-framewor...@googlegroups.com.
>>> >>>>>>>>>> For more options, visit this group at
>>> >>>>>>>>>> http://groups.google.com/group/play-framework?hl=en.
>>> >>>>>>>>>>
>>> >>>>>>>>>

>>> >>>>>>>>> --
>>> >>>>>>>>> You received this message because you are subscribed to the
>>> >>>>>>>>> Google
>>> >>>>>>>>> Groups "play-framework" group.
>>> >>>>>>>>> To post to this group, send email to

>>> >>>>>>>>> play-fr...@googlegroups.com.
>>> >>>>>>>>> To unsubscribe from this group, send email to
>>> >>>>>>>>> play-framewor...@googlegroups.com.
>>> >>>>>>>>> For more options, visit this group at
>>> >>>>>>>>> http://groups.google.com/group/play-framework?hl=en.
>>> >>>>>>>>
>>> >>>>>>>>

>>> >>>>>> --
>>> >>>>>> You received this message because you are subscribed to the Google
>>> >>>>>> Groups
>>> >>>>>> "play-framework" group.
>>> >>>>>> To view this discussion on the web visit
>>> >>>>>> https://groups.google.com/d/msg/play-framework/-/KX-7agj2_rsJ.
>>> >>>>>>
>>> >>>>>> To post to this group, send email to

>>> >>>>>> play-fr...@googlegroups.com.
>>> >>>>>> To unsubscribe from this group, send email to
>>> >>>>>> play-framewor...@googlegroups.com.
>>> >>>>>> For more options, visit this group at
>>> >>>>>> http://groups.google.com/group/play-framework?hl=en.
>>> >>>>>
>>> >>>>>

>>> >>>>> --
>>> >>>>> You received this message because you are subscribed to the Google
>>> >>>>> Groups
>>> >>>>> "play-framework" group.
>>> >>>>> To post to this group, send email to

>>> >>>>> play-fr...@googlegroups.com.
>>> >>>>> To unsubscribe from this group, send email to
>>> >>>>> play-framewor...@googlegroups.com.
>>> >>>>> For more options, visit this group at
>>> >>>>> http://groups.google.com/group/play-framework?hl=en.
>>> >>>>

>>> >>>> --
>>> >>>> You received this message because you are subscribed to the Google
>>> >>>> Groups "play-framework" group.
>>> >>>> To post to this group, send email to

>>> >>>> play-fr...@googlegroups.com.
>>> >>>> To unsubscribe from this group, send email to
>>> >>>> play-framewor...@googlegroups.com.
>>> >>>> For more options, visit this group at
>>> >>>> http://groups.google.com/group/play-framework?hl=en.
>>> >>>>
>>> >>>

>>> >>> --
>>> >>> You received this message because you are subscribed to the Google
>>> >>> Groups "play-framework" group.

>>> >>> To post to this group, send email to play-fr...@googlegroups.com.
>>> >>> To unsubscribe from this group, send email to
>>> >>> play-framewor...@googlegroups.com.
>>> >>> For more options, visit this group at
>>> >>> http://groups.google.com/group/play-framework?hl=en.
>>> >>>
>>> >>

>>> >> --
>>> >> You received this message because you are subscribed to the Google
>>> >> Groups "play-framework" group.

>>> >> To post to this group, send email to play-fr...@googlegroups.com.
>>> >> To unsubscribe from this group, send email to
>>> >> play-framewor...@googlegroups.com.
>>> >> For more options, visit this group at
>>> >> http://groups.google.com/group/play-framework?hl=en.
>>> >>
>>> >
>>> >
>>> >

>>> > --
>>> > Guillaume Bort
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups "play-framework" group.

>>> > To post to this group, send email to play-fr...@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > play-framewor...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/play-framework?hl=en.
>>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "play-framework" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/play-framework/-/MJvHn7eGBrcJ.
>>
>> To post to this group, send email to play-fr...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> play-framewor...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/play-framework?hl=en.
>
>

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.

Reply all
Reply to author
Forward
0 new messages