Re: Users - Any estimate of performance--Bsh vs Minilang vs Java?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Users - Any estimate of performance--Bsh vs Minilang vs Java?

Adrian Crum
I'm sure everyone will have their own opinions on the best strategy for
development. Here's mine...

Development in bsh or mini-lang is fast - because you can modify the code while
the server is running. Development in java is slow because you have to restart
the server every time you recompile.

The approach I've taken is to develop in bsh, then when I'm sure the bsh code is
finished, I move it to java - for speed.


Vinay Agarwal wrote:

> Hello,
>
>  
>
> Knowing approximate performance level is helpful to me for choosing Bsh,
> Minilang, or Java. I understand that bsh can be 100-300 times slower
> than Java. Is there an estimate of Minlang performance compared to Java?
>
>  
>
> Regards,
>
> Vinay Agarwal
>
>
> ------------------------------------------------------------------------
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Any estimate of performance--Bsh vs Minilang vs Java?

Florin T.PATRASCU (work)
+1

Adrian Crum wrote:

> I'm sure everyone will have their own opinions on the best strategy for
> development. Here's mine...
>
> Development in bsh or mini-lang is fast - because you can modify the code while
> the server is running. Development in java is slow because you have to restart
> the server every time you recompile.
>
> The approach I've taken is to develop in bsh, then when I'm sure the bsh code is
> finished, I move it to java - for speed.
>
>
> Vinay Agarwal wrote:
>
>  
>> Hello,
>>
>>  
>>
>> Knowing approximate performance level is helpful to me for choosing Bsh,
>> Minilang, or Java. I understand that bsh can be 100-300 times slower
>> than Java. Is there an estimate of Minlang performance compared to Java?
>>
>>  
>>
>> Regards,
>>
>> Vinay Agarwal
>>
>>    
>  


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Any estimate of performance--Bsh vs Minilang vs Java?

David E. Jones
In reply to this post by Adrian Crum

This varies a lot by the actual code being run... BSH is often slower  
because it has to use a lot of introspection  to dynamically call  
methods, create objects, etc, etc. The mini-lang stuff does _not_  
have this problem unless you are using a lot of call-object-method or  
call-class-method operations (which are not commonly used, or are  
used infrequently to specific Java methods).

Whether it is fast enough or not should ALWAYS be determined through  
profiling if it is important. It is a lot more effort to write a  
service in Java versus in a simple-method, so how do you know if it  
is worth it? The only way to find out is through profiling. Not doing  
so is a somewhat dangerous assumption, so I really wouldn't recommend  
that.

 From my own profiling I've found that the performance difference for  
BSH is not even _close_ to 100-300 times slower, not even close. We  
use a cached class loader and some other things (like caching  
compiled bsh scripts) to significantly improve the speed, but you  
should know that with the performance enhancements in place with  
OFBiz pages that were converted from JSP (which is converted to a  
Java file and compiled) to FTL/BSH were only 20-40% slower. That's a  
long shot from 10,000-30,000% slower... So, yeah, the numbers can be  
a lot different than you think...

So unless you _really_ need a lot of speed and your code involves  
absolutely zero database operations (ie it is tight loop and memory/
cpu intensive) then writing it in Java will result in such a  
negligible difference that it isn't even close to worth the effort  
required to write and maintain it...

Don't worry, we didn't just pull this stuff out of a box without  
playing with it in real world situations, including performance  
constraints and such. I have plenty of experience with profiling and  
optimization coming from a graphics and UI background (even back in  
the days when processor specific assembly code was required for  
decent performance, way before the modern accelerated graphics cards  
and what not). The same principles _always_ apply for optimization:  
write it so it works then test to see what is slow, then find a way  
to speed it up. Doing anything else is just guessing and I know from  
experience that hit/miss ratios for this for most people (even if  
they've done a lot of profiling in other things) is often dead, dead,  
dead wrong and a lot of work goes into almost no performance increase.

-David


On Mar 7, 2006, at 11:25 AM, Adrian Crum wrote:

> I'm sure everyone will have their own opinions on the best strategy  
> for
> development. Here's mine...
>
> Development in bsh or mini-lang is fast - because you can modify  
> the code while
> the server is running. Development in java is slow because you have  
> to restart
> the server every time you recompile.
>
> The approach I've taken is to develop in bsh, then when I'm sure  
> the bsh code is
> finished, I move it to java - for speed.
>
>
> Vinay Agarwal wrote:
>
>> Hello,
>>
>>
>>
>> Knowing approximate performance level is helpful to me for  
>> choosing Bsh,
>> Minilang, or Java. I understand that bsh can be 100-300 times slower
>> than Java. Is there an estimate of Minlang performance compared to  
>> Java?
>>
>>
>>
>> Regards,
>>
>> Vinay Agarwal
>>
>>
>> ---------------------------------------------------------------------
>> ---
>>
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.ofbiz.org/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Users - Any estimate of performance--Bsh vs Minilangvs Java?

Jacques Le Roux
Administrator
Thanks David to sharing your experience.

Jacques

----- Original Message -----
From: "David E. Jones" <[hidden email]>
To: "OFBiz Users / Usage Discussion" <[hidden email]>
Sent: Tuesday, March 07, 2006 9:52 PM
Subject: Re: [OFBiz] Users - Any estimate of performance--Bsh vs Minilangvs
Java?


>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Any estimate of performance--Bsh vs Minilangvs Java?

Vinay Agarwal
In reply to this post by David E. Jones
David,
This is very helpful.
Regards,
Vinay Agarwal

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of David E. Jones
Sent: Tuesday, March 07, 2006 12:52 PM
To: OFBiz Users / Usage Discussion
Subject: Re: [OFBiz] Users - Any estimate of performance--Bsh vs Minilangvs
Java?


This varies a lot by the actual code being run... BSH is often slower  
because it has to use a lot of introspection  to dynamically call  
methods, create objects, etc, etc. The mini-lang stuff does _not_  
have this problem unless you are using a lot of call-object-method or  
call-class-method operations (which are not commonly used, or are  
used infrequently to specific Java methods).

Whether it is fast enough or not should ALWAYS be determined through  
profiling if it is important. It is a lot more effort to write a  
service in Java versus in a simple-method, so how do you know if it  
is worth it? The only way to find out is through profiling. Not doing  
so is a somewhat dangerous assumption, so I really wouldn't recommend  
that.

 From my own profiling I've found that the performance difference for  
BSH is not even _close_ to 100-300 times slower, not even close. We  
use a cached class loader and some other things (like caching  
compiled bsh scripts) to significantly improve the speed, but you  
should know that with the performance enhancements in place with  
OFBiz pages that were converted from JSP (which is converted to a  
Java file and compiled) to FTL/BSH were only 20-40% slower. That's a  
long shot from 10,000-30,000% slower... So, yeah, the numbers can be  
a lot different than you think...

So unless you _really_ need a lot of speed and your code involves  
absolutely zero database operations (ie it is tight loop and memory/
cpu intensive) then writing it in Java will result in such a  
negligible difference that it isn't even close to worth the effort  
required to write and maintain it...

Don't worry, we didn't just pull this stuff out of a box without  
playing with it in real world situations, including performance  
constraints and such. I have plenty of experience with profiling and  
optimization coming from a graphics and UI background (even back in  
the days when processor specific assembly code was required for  
decent performance, way before the modern accelerated graphics cards  
and what not). The same principles _always_ apply for optimization:  
write it so it works then test to see what is slow, then find a way  
to speed it up. Doing anything else is just guessing and I know from  
experience that hit/miss ratios for this for most people (even if  
they've done a lot of profiling in other things) is often dead, dead,  
dead wrong and a lot of work goes into almost no performance increase.

-David


On Mar 7, 2006, at 11:25 AM, Adrian Crum wrote:

> I'm sure everyone will have their own opinions on the best strategy  
> for
> development. Here's mine...
>
> Development in bsh or mini-lang is fast - because you can modify  
> the code while
> the server is running. Development in java is slow because you have  
> to restart
> the server every time you recompile.
>
> The approach I've taken is to develop in bsh, then when I'm sure  
> the bsh code is
> finished, I move it to java - for speed.
>
>
> Vinay Agarwal wrote:
>
>> Hello,
>>
>>
>>
>> Knowing approximate performance level is helpful to me for  
>> choosing Bsh,
>> Minilang, or Java. I understand that bsh can be 100-300 times slower
>> than Java. Is there an estimate of Minlang performance compared to  
>> Java?
>>
>>
>>
>> Regards,
>>
>> Vinay Agarwal
>>
>>
>> ---------------------------------------------------------------------
>> ---
>>
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.ofbiz.org/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users