From: Monmohan S. <mon...@gm...> - 2012-10-05 09:29:37
|
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 |
From: Josh J. <jun...@gm...> - 2012-10-06 14:27:11
|
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 jun...@gm... 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 <mon...@gm...> 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 > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > > |
From: Monmohan S. <mon...@gm...> - 2012-10-08 04:12:02
|
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 <jun...@gm...> 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 > jun...@gm... > 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 <mon...@gm...> 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 >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users >> >> > |
From: <cl...@br...> - 2012-10-08 13:18:10
|
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 cell: +55 13 8117 3316 e-mail: cl...@br... From: Monmohan Singh <mon...@gm...> To: Josh Juneau <jun...@gm...> Cc: jyt...@li... 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 <jun...@gm...> 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 jun...@gm... 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 <mon...@gm...> 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 Jyt...@li... 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 Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Monmohan S. <mon...@gm...> - 2012-10-10 06:56:05
|
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, <cl...@br...> 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 > cell: +55 13 8117 3316 > e-mail: cl...@br... > * > > > From: Monmohan Singh <mon...@gm...> > To: Josh Juneau <jun...@gm...> > Cc: jyt...@li... > 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 <*jun...@gm...*<jun...@gm...>> > 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 > *<http://strattonbrazil.blogspot.com/2011/08/performance-gains-in-jython-252.html> > > Best > > Josh Juneau* > **jun...@gm...* <jun...@gm...>* > **http://jj-blogger.blogspot.com* <http://jj-blogger.blogspot.com/>* > **https://www.apress.com/index.php/author/author/view/id/1866*<https://www.apress.com/index.php/author/author/view/id/1866> > > > > > On Fri, Oct 5, 2012 at 4:29 AM, Monmohan Singh <*mon...@gm...*<mon...@gm...>> > 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*<http://p.sf.net/sfu/newrelic-dev2dev> > _______________________________________________ > Jython-users mailing list* > **Jyt...@li...* <Jyt...@li...> > * > **https://lists.sourceforge.net/lists/listinfo/jython-users*<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 > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > > |
From: Olivier R. <oli...@gm...> - 2012-10-10 07:04:21
|
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 <mon...@gm...> 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, <cl...@br...> 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 > cell: +55 13 8117 3316 > e-mail: cl...@br... > > > > From: Monmohan Singh <mon...@gm...> > To: Josh Juneau <jun...@gm...> > Cc: jyt...@li... > 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 <jun...@gm...> 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 > jun...@gm... > 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 <mon...@gm...> 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 > Jyt...@li... > 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 > Jyt...@li... > 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 > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Chris C. <Chr...@ac...> - 2012-10-10 15:43:14
|
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 <oli...@gm...> 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 <mon...@gm... > <mailto:mon...@gm...>> 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, <cl...@br... >> <mailto:cl...@br...>> 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: cl...@br... <mailto:cl...@br...> >> * >> >> >> From: Monmohan Singh <mon...@gm... >> <mailto:mon...@gm...>> >> To: Josh Juneau <jun...@gm... <mailto:jun...@gm...>> >> Cc: jyt...@li... >> <mailto:jyt...@li...> >> 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 >> <_ju...@gm..._ <mailto:jun...@gm...>> 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_ >> __j...@gm..._ <mailto:jun...@gm...>_ >> __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 >> <_mo...@gm..._ <mailto:mon...@gm...>> 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_ >> __J...@li..._ >> <mailto:Jyt...@li...>_ >> __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 >> Jyt...@li... >> <mailto:Jyt...@li...> >> 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 >> Jyt...@li... >> <mailto:Jyt...@li...> >> 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 > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Santosh T. <ti...@gm...> - 2012-10-10 17:10:18
|
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 <Chr...@ac...>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 > <oli...@gm...> 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 <mon...@gm... > > <mailto:mon...@gm...>> 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, <cl...@br... > >> <mailto:cl...@br...>> 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: cl...@br... <mailto:cl...@br...> > >> * > >> > >> > >> From: Monmohan Singh <mon...@gm... > >> <mailto:mon...@gm...>> > >> To: Josh Juneau <jun...@gm... <mailto:jun...@gm...>> > >> Cc: jyt...@li... > >> <mailto:jyt...@li...> > >> 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 > >> <_ju...@gm..._ <mailto:jun...@gm...>> 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_ > >> __j...@gm..._ <mailto:jun...@gm...>_ > >> __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 > >> <_mo...@gm..._ <mailto:mon...@gm...>> 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_ > >> __J...@li..._ > >> <mailto:Jyt...@li...>_ > >> __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 > >> Jyt...@li... > >> <mailto:Jyt...@li...> > >> 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 > >> Jyt...@li... > >> <mailto:Jyt...@li...> > >> 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 > > Jyt...@li... > > 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 > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > -- Santosh Tiwari ti...@gm... |
From: Chris C. <Chr...@ac...> - 2012-10-10 17:22:43
|
On Wednesday 2012-10-10 10:15 (-0700), Santosh Tiwari <ti...@gm...> wrote: > ..... > > 2. The Jython jar file is huge (8.4 MB). It would be nice if it was > significantly smaller. To get a smaller size I'm using Jython 2.2 and a bunch of additional python 2.3 libs. Check out https://bitbucket.org/clach04/jython/downloads for a ~2Mb jar. I should look at how I could shrink 2.5+ but I've not had time/a compelling need. You can use generators (yield via future import), decorators require more thought as @ is not supported but you can manually wrap functions. The main issue I see with Jython 2.2 (ignoring the old syntax/library and that it isn't supported) is that the regex library is horrible, possibly due to the way strings/Unicode are treated differently. Chris |
From: Santosh T. <ti...@gm...> - 2012-10-10 18:58:18
|
Thanks. I looked at the servlet code. The PySystemState cannot be shared by multiple PythonInterpreter objects. What if I have multiple PythonInterpreters executing some code in different threads? Can I share the PySystemState between them? On Wed, Oct 10, 2012 at 2:00 PM, Jarosław Szczepankiewicz < jsz...@gm...> wrote: > > 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. > > > > This is probably not 100% correct please see usage PySystemState and > python interpeter in Modjyservlet: > > > http://www.jarvana.com/jarvana/view/org/python/jython-standalone/2.5.2/jython-standalone-2.5.2-sources.jar!/com/xhaus/modjy/ModjyJServlet.java?format=ok > > Servlet is by design not thread safe so they will be using some > synchronisation if the PySystemState was not thread safe. > -- Santosh Tiwari ti...@gm... |
From: Alan K. <jyt...@xh...> - 2012-10-13 16:17:53
|
Greetings from PyCon Ireland 2012. Time to rectify some misinformation. >> Servlet is by design not thread safe This statement is false. The Java servlet API is thread-safe by design. If the user writes a servlet that is not thread-safe, then in previous versions of the servlet API, they could declare that to the container by implementing the SingleThreadModel interface http://docs.oracle.com/javaee/1.4/api/javax/servlet/SingleThreadModel.html But that was deprecated, because it gave a false sense of security to users who did not understand threading, or what thread-safety means. WSGI solves the problem differently, where the container informs the application if it might be invoked concurrently in multiple threads: this is the purpose of the "wsgi.multithread" environment value """ wsgi.multithread: This value should evaluate true if the application object may be simultaneously invoked by another thread in the same process, and should evaluate false otherwise. """ Whether or not the container implements threading is a container concern. """ Thread support, or lack thereof, is also server-dependent. Servers that can run multiple requests in parallel, should also provide the option of running an application in a single-threaded fashion, so that applications or frameworks that are not thread-safe may still be used with that server. """ www.python.org/dev/peps/pep-3333/#thread-support Modjy, the jython WSGI->servlet adapter is completely threadsafe, as are the java servlet containers in which it is run, by design. But modjy does give the user an option which is the equivalent of the SingleThreadModel, the "multithread" option, which is documented as follows """ multithread: ... If your application object is not thread-safe, you should set this flag to zero, thus ensuring that the application will only ever be called from one thread at a time. This is achieved by exclusively locking and unlocking the application callable before and after each request, so that the application services only one request at a time. """ http://opensource.xhaus.com/projects/modjy/wiki/ModjyConfiguration > The PySystemState cannot be shared by multiple PythonInterpreter objects. > > What if I have multiple PythonInterpreters executing some code in different > threads? Can I share the PySystemState between them? These statements ar contradictory. Firstly you state that PySystemState objects cannot be shared, and then in the next sentence ask if they can be shared. The answer is yes, they can be shared. This email thread discusses the issue in some detail. Is PyCode thread-safe? http://python.6.n6.nabble.com/Fwd-is-PyCode-thread-safe-td1773026.html Alan. |
From: Santosh T. <ti...@gm...> - 2012-10-13 16:35:35
|
Let me rephrase and restate what I was saying (again correct me if I am wrong, it will help me improve performance of my application). PyCode (as in compiled python) is thread-safe. Same compiled code can be executed *simultaneously* from different threads. PySystemState although can be shared by multiple different PythonInterpreter objects, but then you have to lock the state (synchronize their execution) if you have multiple threads. Assume that I wish to run more than one compiled python code or the same python code but with different inputs at the same time (to take advantage of multi-core processors). If I use the same PySystemState to store all the information for different threads, then everything will get corrupted. If I synchronize (effectively making the execution sequential), then the state wont be corrupted, but then I loose the advantage of multiple processors. Now in reality, in my specific case, its not the jython that is expensive, but other stuff that takes time. So I can still get away with synchronizing without affecting performance too much. On Sat, Oct 13, 2012 at 12:17 PM, Alan Kennedy <jyt...@xh...> wrote: > Greetings from PyCon Ireland 2012. > > Time to rectify some misinformation. > > >> Servlet is by design not thread safe > > This statement is false. > > The Java servlet API is thread-safe by design. If the user writes a > servlet that is not thread-safe, then in previous versions of the > servlet API, they could declare that to the container by implementing > the SingleThreadModel interface > > http://docs.oracle.com/javaee/1.4/api/javax/servlet/SingleThreadModel.html > > But that was deprecated, because it gave a false sense of security to > users who did not understand threading, or what thread-safety means. > > WSGI solves the problem differently, where the container informs the > application if it might be invoked concurrently in multiple threads: > this is the purpose of the "wsgi.multithread" environment value > > """ > wsgi.multithread: This value should evaluate true if the application > object may be simultaneously invoked by another thread in the same > process, and should evaluate false otherwise. > """ > > Whether or not the container implements threading is a container concern. > > """ > Thread support, or lack thereof, is also server-dependent. Servers > that can run multiple requests in parallel, should also provide the > option of running an application in a single-threaded fashion, so that > applications or frameworks that are not thread-safe may still be used > with that server. > """ > > www.python.org/dev/peps/pep-3333/#thread-support > > Modjy, the jython WSGI->servlet adapter is completely threadsafe, as > are the java servlet containers in which it is run, by design. > > But modjy does give the user an option which is the equivalent of the > SingleThreadModel, the "multithread" option, which is documented as > follows > > """ > multithread: ... If your application object is not thread-safe, you > should set this flag to zero, thus ensuring that the application will > only ever be called from one thread at a time. This is achieved by > exclusively locking and unlocking the application callable before and > after each request, so that the application services only one request > at a time. > """ > > http://opensource.xhaus.com/projects/modjy/wiki/ModjyConfiguration > > > The PySystemState cannot be shared by multiple PythonInterpreter objects. > > > > What if I have multiple PythonInterpreters executing some code in > different > > threads? Can I share the PySystemState between them? > > These statements ar contradictory. Firstly you state that > PySystemState objects cannot be shared, and then in the next sentence > ask if they can be shared. > > The answer is yes, they can be shared. > > This email thread discusses the issue in some detail. > > Is PyCode thread-safe? > http://python.6.n6.nabble.com/Fwd-is-PyCode-thread-safe-td1773026.html > > Alan. > -- Santosh Tiwari ti...@gm... |
From: Alan K. <jyt...@xh...> - 2012-10-13 17:35:59
|
> PySystemState although can be shared by multiple different PythonInterpreter > objects, but then you have to lock the state (synchronize their execution) > if you have multiple threads. No. PySystemState is the component of the runtime environment where context, e.g. module search path, is stored. PySystemState is what implements the sys module. So if you import sys and do some inspection on it, e.g. "dir(sys)", you're looking at a PySystemState object. PythonInterpreter objects that share a PySystemState will share that sys module, and no synchronization is necessary for those PythonInterpresters to share it. With a single exception: the exec and execfile calls need to be synchronized. So if you're executing code in a PythonInterpreter to, for example, provide APIs to embedded code, then the "exec" call should be executed only by a single thread at a time. But generally these calls should only ever be executed once anyway, so this is a minor concern. > Now in reality, in my specific case, its not the jython that is expensive, > but other stuff that takes time. So I can still get away with synchronizing > without affecting performance too much. Jython is completely threadsafe. Whether or not your code or its dependencies is also threadsafe is a completely separate concern. Alan. |
From: Santosh T. <ti...@gm...> - 2012-10-13 19:31:23
|
Thanks for clearing that up. So the exec() function call needs to be synchronized - which is what I am concerned with. In my application, I compile the python code once, and then execute is multiple times with different input data. Now, if I have multiple PythonInterpreter objects each sharing the same PySystemState, can I execute them simultaneously. I can provide some sample code (SSCE) to demonstrate the exact issue. On Sat, Oct 13, 2012 at 1:35 PM, Alan Kennedy <jyt...@xh...> wrote: > > PySystemState although can be shared by multiple different > PythonInterpreter > > objects, but then you have to lock the state (synchronize their > execution) > > if you have multiple threads. > > No. > > PySystemState is the component of the runtime environment where > context, e.g. module search path, is stored. PySystemState is what > implements the sys module. So if you import sys and do some inspection > on it, e.g. "dir(sys)", you're looking at a PySystemState object. > > PythonInterpreter objects that share a PySystemState will share that > sys module, and no synchronization is necessary for those > PythonInterpresters to share it. > > With a single exception: the exec and execfile calls need to be > synchronized. So if you're executing code in a PythonInterpreter to, > for example, provide APIs to embedded code, then the "exec" call > should be executed only by a single thread at a time. But generally > these calls should only ever be executed once anyway, so this is a > minor concern. > > > Now in reality, in my specific case, its not the jython that is > expensive, > > but other stuff that takes time. So I can still get away with > synchronizing > > without affecting performance too much. > > Jython is completely threadsafe. > > Whether or not your code or its dependencies is also threadsafe is a > completely separate concern. > > Alan. > -- Santosh Tiwari ti...@gm... |
From: Alan K. <jyt...@xh...> - 2012-10-14 15:10:13
|
> So the exec() function call needs to be synchronized - which is what I am > concerned with. In my application, I compile the python code once, and then > execute is multiple times with different input data. > > Now, if I have multiple PythonInterpreter objects each sharing the same > PySystemState, can I execute them simultaneously. Yes. As long as your own code is threadsafe, you should have no problems. > I can provide some sample code (SSCE) to demonstrate the exact issue. If you can provide a short code sample, then that might help us understand what the issue is. Alan. |