[reportlab-users] patch to make Reportlab work again on Jython

Raphaël Valyi rvalyi at gmail.com
Tue Feb 3 20:41:29 EST 2009


Hi Andy and all,

yes, Jython knows the '__all__' variable, so may be you can use it
for the patch.
Also, I didn't try that, but I think my patch could differ less from
the original file. Indeed, I wrapped almost every large list
instantiation of pdfbase/_fontdata.py in a private method, but I guess
that wrapping only a few of them will already make the containing
method small enough for the JVM to handle it.

Any way, as I said, it's more about applying that dummy patch that has
no impact except it's not beautiful (but not so ugly either). Flag it
with a big #FIXME remove that when Jython folks fix the issue, and
indeed remove the patch in one or two years when Jython doesn't has
the issue anymore. As I said, it's not a top priority bug for Jython
(hard to fix but rarely occurs). But on the contrary, having softwares
like Reportlab or OpenERP running on Jython would also certainly help
Sun putting more resources on that, finally helping reportlab too.

And to answer your other question, I'm running my test without any
accelerator for the moment (happy to know there were one). Having an
accelerator is not a top priority for OpenERP on Jython, we should
first focus on compatibility, and even if Reportlab is expected to be
100% compatible after my patch is applied, there are a few other
issues to port OpenERP on Jython. And since it's still a spare time
challenge...

Finally, be sure I can run your test suite and provide some feedback
(including speed) if Reportlab lets me run it on Jython. I doubt
Reportlab will be faster on Jython that soon, but it might be for the
end of the year. Bare in mind that JRuby is 2 to 5 times faster than C
Ruby (http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=jruby&lang2=ruby
more to come...) . JRuby got much more momentum at Sun to go there,
plus they had outstanding rock stars like Charles Nutter in their
team. Jython got less momentum, but reborn after JRuby proved amazing
things could be done on the top of the JVM. After specialists like
Charles Nutter or Jim Baker, Jython will go there, probably by the end
of the year already, they can reuse a lot what has been done for JRuby
too. A 99% 2.5 Python compliant Jython is expected by February.

An other thing to consider if you are interested in Jython is Jython
multitreading abilities (unlike Python which is sticking to a GIL).
For multithreading enable applications, that means more performance
and much less memory use (thanks to the shared runtime that can
completely compensate the JVM extra memory usage) under huge
concurrent loads. Other benefit are portability.

If one of you is interested in the OpenERP+reportlab on Jython topic,
I started a blog post here:
http://rvalyi.blogspot.com/2009/02/openerp-running-on-java-jython-round-1.html


Hope to see something done for Jython compatibility. Best regards,

Raphaël Valyi.


On Fri, Jan 30, 2009 at 5:24 PM, Andy Robinson <andy at reportlab.com> wrote:

> Raphaël, does Jython pay attention to '__all__' ? If so,

> perhaps we could do something less hacky

> and just list the bits we want in an '__all__' variable.

>

> Sorry but I don't have time to experiment on Jython itself.

>

> - Andy

>



More information about the reportlab-users mailing list