I echo Oti on this, we should use bytecode verification even if it results in slower startups. As I understand the third option, we can make it transparent, but until then, "correctness first" seems to imply that we do not unnecessarily break code.

- Jim

On Thu, Mar 5, 2009 at 3:17 PM, Oti <ohumbel@gmail.com> wrote:
Frank,

thanks for bringing this up here !

In the meantime i did some measurements. The environment is as follows:

Mac OS X, Version 10.5.6
2.4 GHz Intel Core 2 Duo
2 GB 667 MHz DDR2 SDRAM
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

[test.sh]:
declare -i count
count=50
while [ $(($count > 0)) == "1" ] ; do
 ./jython ./start.py
 count=count-1
done

[testverify.sh]:
declare -i count
count=50
while [ $(($count > 0)) == "1" ] ; do
 ./jython --verify ./start.py
 count=count-1
done

[start.py]:
import sys
sys.exit()

This means 50 times: start jython, import sys and immediately exit.
The results are here:

jekyll:jython-2.5b1 oti$ time ./test.sh
real    0m44.305s
user    0m36.449s
sys     0m5.212s
jekyll:jython-2.5b1 oti$ time ./test.sh
real    0m47.551s
user    0m37.160s
sys     0m5.421s
jekyll:jython-2.5b1 oti$ time ./test.sh
real    0m44.194s
user    0m36.504s
sys     0m5.232s
jekyll:jython-2.5b1 oti$ time ./testverify.sh
real    1m19.790s
user    1m10.764s
sys     0m5.884s
jekyll:jython-2.5b1 oti$ time ./testverify.sh
real    1m25.698s
user    1m12.471s
sys     0m6.181s
jekyll:jython-2.5b1 oti$ time ./testverify.sh
real    1m20.484s
user    1m11.018s
sys     0m5.908s

I hope this gives you an idea what times we are talking about: ~0.9s
versus ~1.7s

On the other side, i am very much concerned about the regression we
would introduce, and about all the novice users driven away by basic
stuff not working.
Telling people to use --verify is not so much fun (and looks clumsy),
telling people who *really* need it to use --boot probably makes more
sense.
And then there are some users who depend on sys.executable (e.g.
ez_setup.py), and they IMHO have no chance of specifying '--verify'.

So my vote is to have bytecode verification on by default, as long as
we have no stable workaround out of the box.
See http://pylonshq.com/pasties/3ee03faf7e18e39a4ca7a2005eba2e0a for
the suggested patch.

Thanks, and best wishes,
Oti.



On Thu, Mar 5, 2009 at 10:02 PM, Frank Wierzbicki <fwierzbicki@gmail.com> wrote:
> So right now the jython shell defaults to putting jython.jar on the
> boot classpath.  This is nice, because it greatly speeds up startup
> time.  The downside, is that tricks like Class.forName() fail to work
> under these circumstances.  Oti has suggested we switch back to the
> old default behavior, and put jython.jar on a normal classpath.  This
> will solve the forName problems, but will make the typical Jython
> commandline usage slow.   See http://bugs.jython.org/issue1127 for
> more on the problem.
>
> There is a third alternative, and that would be to make sure our Java
> dispatching goes through a normal classpath in the code -- Philip
> Jenvey suggested that dynamic class lookups go through __import__.
>
> I'd like to take a crack at option #3, but it won't make this Friday's
> beta.  For Friday, I think I'm going to leave it as --verify, but
> we'll need to fix this or decide very soon.
>
> -Frank
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Jython-dev mailing list
> Jython-dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-dev
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Jython-dev mailing list
Jython-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev



--
Jim Baker
jbaker@zyasoft.com