From: Jeff E. <jem...@fr...> - 2012-02-25 16:54:47
|
I ran your test on Windows, and it is still slow, so it is not a Mac problem. I don't know the reason it is so slow, but I noticed that in old versions of Jython (2.1 and 2.2), your script takes about 5 seconds instead of 60. If you change your script to create a 4D array explicitly, then it runs much faster. This ran in about 1ms for me, which is the same time as without the overloaded 3D array method. import time,TestClass n1,n2,n3 = 250,250,250 z = TestClass.zeros(n1,n2,n3) import java,jarray z4d = jarray.array([z,z,z],java.lang.Class.forName('[[[F')) start = time.time() TestClass.overloaded(z4d) print 'time =',(time.time()-start) On 2/24/2012 6:21 PM, wa wrote: > Hello, > > Jython newbie here, so I apologize if this is a silly question. I am seeing > some strange behavior I don't understand when I call an overloaded Java > method from a Jython script. > > Here is my Java class: > > and here is my Jython script: > > This Jython script takes about 1 minute to run (I'm on a Mac, if that > matters), but if I comment out the first method in TestClass.java the script > takes almost no time at all. I'm confused why it takes so much longer when > the method is overloaded. Am I missing something here? > > -- > View this message in context: http://python.6.n6.nabble.com/slow-overloaded-method-tp4504592p4504592.html > Sent from the jython-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |