|
From: German M. <ger...@de...> - 2001-04-05 14:00:24
|
Hi everybody,
Before anything else, sorry for my English.
I don't know if this is message should go in jython-users
list or in the jython-dev list, so I apologize in advance
if it is in the wrong place.
I'm new in the list, but I used JPython (now Jython) on and
off for about 2 years.
I have an application written in Java that uses Jython for
the annoying business details, as a way for my customers
to customize the application for their needs.
Anything goes OK, but I'm concerned about the performance.
In a standard Java application, you can use a Java Profiler
(there are a lot) to see where the performance bottleneck
is.
In the case of a Jython code, those profilers come up with a
useless conclusion: the time is consumed in
PythonInterpreter.exec(PyCode compiledPyCode).
I'm looking for a tool that show me the time elapsed in
each Jython function or method.
Having found nothing in a quick search on Google and with
the same result in this lists, I've made some changes to
PyTableCode.java, so when I execute 'jython Test.py',
where Test.py is:
## ----------------------------------------
class TestClass:
def __init__(self):
self.a = 1
def __str__(self):
return str(self.a)
def printFunction(_testClass):
print str(_testClass)
def createFunction():
return TestClass()
_testClass = createFunction()
printFunction(_testClass)
## ----------------------------------------
I get this result:
## ----------------------------------------
begin - time:986420318682 - code:?
begin - time:986420318685 - code:TestClass
end - time:986420318686
begin - time:986420318686 - code:createFunction
begin - time:986420318687 - code:__main__.TestClass.__init__
end - time:986420318687
end - time:986420318687
begin - time:986420318688 - code:__main__.TestClass.printFunction
begin - time:986420318691 - code:__main__.TestClass.__str__
end - time:986420318697
end - time:986420318701
end - time:986420318701
## ----------------------------------------
The numbers are java.lang.System.currentTimeMillis() calls.
The next step is to write a program to analize this output.
But, before going on with my efforts, I wish to ask you some
questions.
0. There is some tool already done to do this job?
1. If not... What do you think of my aproach?
2. Is someone else interested in profiling jython code?
Thanks in advance for your time.
German Morales
|