Title: .py file size on jython 2.5.2
Type: behaviour Severity: critical
Components: Any Versions: Jython 2.5
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: rpasup, zyasoft
Priority: Keywords:

Created on 2016-02-24.05:22:19 by rpasup, last changed 2016-03-14.23:49:27 by zyasoft.

msg10768 (view) Author: Rajasekhar (rpasup) Date: 2016-02-24.05:22:18
hi team,
ii would like to know the  max file size of the .py files and also methods size inside the .py files supported by jython version 2..5.2.

Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[Java HotSpot(TM) Client VM (Oracle Corporation)] on java1.7.0_51
Type "help", "copyright", "credits" or "license" for more information.
msg10799 (view) Author: Jim Baker (zyasoft) Date: 2016-03-04.00:19:07
Maximum size is dictated by the underlying Java class file format.
msg10809 (view) Author: Rajasekhar (rpasup) Date: 2016-03-10.06:02:02
Hi Jim,

Thanks for the response.

So that means there is no max size limit for .py file and size is dictated by the application which converts the .py file to .class file.
Is my understanding correct?.

msg10811 (view) Author: Rajasekhar (rpasup) Date: 2016-03-10.06:56:41
Hi Jim,

We have gone through the ticket

Which is similar to the case specified in current ticket.

As per the ticket 1891, Splitting the larger methods (Inside .py files) in to small peices will work, But this is just a work around.
Even we followed the same procedure of splitting the content of .py file, And in fact it's working in our customer server (O2 UK).

And also it was specified in the ticket (1891), Issue will get solved if the jython version is 2.7 without applying work around(Splitting of method content).

Based on the above can we suggest our customer to upgrade from jython 2.5.2 to jython 2.7.

msg10820 (view) Author: Jim Baker (zyasoft) Date: 2016-03-14.23:49:26
In general, 2.7.0 does a better job with large methods than 2.5.x, due to collection literal splitting, which is by far the most common case, as seen in the discussion of #1891. In most cases, such large methods are code generated and are usually quite simple.

However, not all large modules are so simple. So I'm aware of one specific case, Ply, which generates too large methods that neither use splittable literals; and is non trivial to split. It requires #527524 to be solved.

There is a workaround, which is to compile to Python bytecode, and then use pycimport, but this is considered *experimental* at this time. It will be supported at some point in the 2.7.x dev lifecycle, but it has not been prioritized (ie, not likely to be in 2.7.2).

Hope that helps!
Date User Action Args
2016-03-14 23:49:27zyasoftsetmessages: + msg10820
2016-03-10 06:56:41rpasupsetmessages: + msg10811
2016-03-10 06:02:02rpasupsetmessages: + msg10809
2016-03-04 00:19:08zyasoftsetnosy: + zyasoft
messages: + msg10799
2016-02-24 05:22:19rpasupcreate