Here are my observations (we use jython in our application).

1. Jython start-up time is slow. However, once it it loaded, it is fast.

2. The Jython jar file is huge (8.4 MB). It would be nice if it was significantly smaller.

3. The performance depends upon your intended usage (it may vary based on what you are doing). In our case, we pre-compile the jython code which can change, and then execute the pre-compiled code with different inputs.

4. A pre-compiled code runs extemely fast (the code mostly has string processing and number crunching). Its not as fast as Java, but good enough not to be a problem. If the execution time is too slow for your case, then you should consider a different approach. Jython (FWIW) is not intended for heavy number crunching.

5. From what I know, jython is not multi-threaded, nor is threadsafe. The class "org.python.core.PySystemState" cannot be shared between multiple instances.

Correct me if I am wrong. Also, if any of you know workarounds/tips to further speed-up performance, it would be great.








On Wed, Oct 10, 2012 at 11:43 AM, Chris Clark <Chris.Clark@actian.com> wrote:
I can't tell from the tenses used below if you are suggesting this as a
possibility to explore or if this is something you've already done.

Do you have demo code that shows this faster startup? It would be cool
to take a look at it.

Thanks,

Chris

On Wednesday 2012-10-10 08:41 (-0700), Olivier Rossel
<olivier.rossel@gmail.com> wrote:
> From my quick investigation, Jython takes an awful lot of time finding
> classes and .py in the classpath and filesystem (trying many possible
> locations). Plus it takes several seconds to parse the unicodeData.txt
> file.
> Stripping those two steps down makes Jython to launch much faster.
>
> My humble 2 cents.
>
> Envoyé de mon iPad
>
> Le 10 oct. 2012 à 08:55, Monmohan Singh <monmohan@gmail.com
> <mailto:monmohan@gmail.com>> a écrit :
>
>> thanks for the summary.
>> In Jython FAQ here
>> http://www.jython.org/archive/22/userfaq.html#how-fast-is-jython, it
>> says
>> /"However, because of Java's slow startup time, Jython starts much
>> more slowly (2.4 s) than CPython (80 ms). This means you don't want
>> to do standard CGI in Jython, but long-running processes are fine."/
>> I guess that still holds true but should be largely dependent on the
>> platform and the VM implementation.
>> Regards
>> Monmohan
>>
>> On Mon, Oct 8, 2012 at 6:16 PM, <claudef@br.ibm.com
>> <mailto:claudef@br.ibm.com>> wrote:
>>
>>     Dear colleagues,
>>
>>     "Jython, a slow running Ferrari .."
>>
>>     When I started with coding Jython in year 2006 I knew it was slow
>>     (its invoke took more than one second).
>>
>>      Its hard to benchmark performance, as the user experience
>>     results from a mix of  IT related processes, like CPU clock,
>>     memory cache, I/O performance, net performance and  cryptography
>>     steps like the one used by the transport of SSL protocols.
>>
>>      Sometimes less is more. A good example is that Jython runs on a
>>     slim JVM, which in case of IBM's CPUs runs a well tuned version
>>     of IBM Java 6 SE (or now at Java 7 SE), which are designed to
>>     make use of several hardware based accelerated features, mainly
>>     at the Power 7 and system z "mainframe" architecture.  When I
>>     compare it now in year 2012, its likely that I see untuned JEE
>>     web components and compare it to lighter running, scripting based
>>     solutions developed under Jython & Java 6 EE. So what is my
>>     conclusion:  As evolution moves forward, the processors use to
>>     increase its performance and double its capacity every year. Its
>>     good to correlate all factors and measure it from a user
>>     experience standpoint.
>>
>>      I see a fast running Rolls-Royce that maps the Java EE world, I
>>     also see a slow running Ferrari that maps de Java & Jython
>>     servlets given the user an experience of no longer than 1 second
>>     response time, even for pythonic analytics.
>>
>>      So in this analysis, which is not a scientific benchmark, my
>>     conclusion is that Jython,  usually at a 2.5.2 production level,
>>     today does its job very well.
>>
>>     Regards,
>>     Claude
>>
>>     *
>>     Claude Falbriard
>>     Certified IT Specialist L2 - Middleware
>>     AMS Hortolândia / SP - Brazil
>>     phone: +55 19 9837 0789 <tel:%2B55%2019%209837%200789>
>>     cell: +55 13 8117 3316 <tel:%2B55%2013%208117%203316>
>>     e-mail: claudef@br.ibm.com <mailto:claudef@br.ibm.com>
>>     *
>>
>>
>>     From: Monmohan Singh <monmohan@gmail.com
>>     <mailto:monmohan@gmail.com>>
>>     To: Josh Juneau <juneau001@gmail.com <mailto:juneau001@gmail.com>>
>>     Cc: jython-users@lists.sourceforge.net
>>     <mailto:jython-users@lists.sourceforge.net>
>>     Date: 08/10/2012 01:11
>>     Subject: Re: [Jython-users] jython performance
>>     ------------------------------------------------------------------------
>>
>>
>>
>>     thanks Josh.
>>     Seems pretty good.
>>     I did Google it and there were some reports about older versions
>>     of jython running 50x slower than cpython which seemed somewhat
>>     unreasonable to me. I was therefore looking for some authentic
>>     source about any recent performance comparisons, specifically
>>     jython 2.5.3+
>>
>>     Regards
>>     Monmohan
>>
>>     On Sat, Oct 6, 2012 at 7:57 PM, Josh Juneau
>>     <_juneau001@gmail.com_ <mailto:juneau001@gmail.com>> wrote:
>>     Monmohan-
>>
>>     I am not sure if there are any recent benchmarks, but if you
>>     Google "Jython Performance" then you should come up with a number
>>     of benchmarks from the past.  Perhaps this is one of the most
>>     recent:
>>     _http://strattonbrazil.blogspot.com/2011/08/performance-gains-in-jython-252.html_
>>
>>
>>     Best
>>
>>     Josh Juneau_
>>     __juneau001@gmail.com_ <mailto:juneau001@gmail.com>_
>>     __http://jj-blogger.blogspot.com_ <http://jj-blogger.blogspot.com/>_
>>     __https://www.apress.com/index.php/author/author/view/id/1866_
>>
>>
>>
>>
>>     On Fri, Oct 5, 2012 at 4:29 AM, Monmohan Singh
>>     <_monmohan@gmail.com_ <mailto:monmohan@gmail.com>> wrote:
>>     Hi,
>>     Are there any performance benchmarks available for jython vs.
>>     java and cpython?
>>     We are starting a new project where I would like to advocate use
>>     of jython for succinctness but would like to understand
>>     performance implications, if any.
>>     Appreciate any response.
>>     Regards
>>     Monmohan
>>
>>     ------------------------------------------------------------------------------
>>     Don't let slow site performance ruin your business. Deploy New
>>     Relic APM
>>     Deploy New Relic app performance management and know exactly
>>     what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>     Try New Relic at no cost today and get our sweet Data Nerd shirt
>>     too!_
>>     __http://p.sf.net/sfu/newrelic-dev2dev_
>>     _______________________________________________
>>     Jython-users mailing list_
>>     __Jython-users@lists.sourceforge.net_
>>     <mailto:Jython-users@lists.sourceforge.net>_
>>     __https://lists.sourceforge.net/lists/listinfo/jython-users_
>>
>>
>>     ------------------------------------------------------------------------------
>>     Don't let slow site performance ruin your business. Deploy New
>>     Relic APM
>>     Deploy New Relic app performance management and know exactly
>>     what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>     Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>     http://p.sf.net/sfu/newrelic-dev2dev_______________________________________________
>>     Jython-users mailing list
>>     Jython-users@lists.sourceforge.net
>>     <mailto:Jython-users@lists.sourceforge.net>
>>     https://lists.sourceforge.net/lists/listinfo/jython-users
>>
>>
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> Jython-users mailing list
>> Jython-users@lists.sourceforge.net
>> <mailto:Jython-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/jython-users
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
>
>
> _______________________________________________
> Jython-users mailing list
> Jython-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users



--
Santosh Tiwari
tiwaris@gmail.com