#jython IRC Log (v0.9)


IRC Log for 2013-11-14

Timestamps are in GMT/BST.

[0:02] <sinistersnare> wish i could just go to europe :p
[1:10] * lheuer1 (~Adium@f049107215.adsl.alicedsl.de) has joined #jython
[1:10] * lheuer (~Adium@unaffiliated/lheuer) Quit (Read error: Connection reset by peer)
[2:31] * xymox (lechuck@unaffiliated/contempt) Quit (Ping timeout: 272 seconds)
[2:31] * xymox (lechuck@unaffiliated/contempt) has joined #jython
[2:39] * webskipper (~webskippe@91-64-7-0-dynip.superkabel.de) has joined #jython
[2:53] * lheuer1 (~Adium@f049107215.adsl.alicedsl.de) Quit (Quit: Leaving.)
[3:43] * webskipper (~webskippe@91-64-7-0-dynip.superkabel.de) Quit (Read error: Connection reset by peer)
[5:30] * Oti (~ohumbel@ Quit (Ping timeout: 246 seconds)
[6:49] * lheuer (~Adium@f049107215.adsl.alicedsl.de) has joined #jython
[6:49] * lheuer (~Adium@f049107215.adsl.alicedsl.de) Quit (Changing host)
[6:49] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[6:50] * lheuer (~Adium@unaffiliated/lheuer) Quit (Client Quit)
[7:05] * lheuer (~Adium@f049107215.adsl.alicedsl.de) has joined #jython
[7:05] * lheuer (~Adium@f049107215.adsl.alicedsl.de) Quit (Changing host)
[7:05] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[8:46] * 20WAAKLSS (~jbaker@c-71-237-106-195.hsd1.co.comcast.net) has joined #jython
[8:46] * whg (whg@unaffiliated/whg) Quit (Changing host)
[8:46] * whg (whg@nat/ibm/x-bxralzmcwrgxlnne) has joined #jython
[8:47] * jimbaker (~jbaker@unaffiliated/jimbaker) Quit (*.net *.split)
[8:47] * shashank (~shashank@ Quit (*.net *.split)
[8:47] * shashank (~shashank@ has joined #jython
[9:34] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[10:04] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Quit: jarekps)
[10:06] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[10:54] * lheuer1 (~Adium@f049107215.adsl.alicedsl.de) has joined #jython
[10:55] * lheuer (~Adium@unaffiliated/lheuer) Quit (Ping timeout: 244 seconds)
[10:56] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Quit: jarekps)
[11:13] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[11:23] * lheuer1 (~Adium@f049107215.adsl.alicedsl.de) Quit (Quit: Leaving.)
[11:24] * lheuer (~Adium@f049107215.adsl.alicedsl.de) has joined #jython
[11:24] * lheuer (~Adium@f049107215.adsl.alicedsl.de) Quit (Changing host)
[11:24] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[13:02] * robbyoconnor (~wakawaka@cpe-68-174-56-147.hvc.res.rr.com) has joined #jython
[13:02] * robbyoconnor (~wakawaka@cpe-68-174-56-147.hvc.res.rr.com) Quit (Client Quit)
[14:25] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Quit: jarekps)
[14:37] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[15:09] * mcurve (~quassel@pop.nakinasystems.com) Quit (Read error: Connection reset by peer)
[15:13] * mcurve (~quassel@pop.nakinasystems.com) has joined #jython
[15:26] * leo-the-manic (~leo@rrcs-24-97-142-42.nys.biz.rr.com) has joined #jython
[15:56] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) has joined #jython
[16:00] * xymox (lechuck@unaffiliated/contempt) Quit (Ping timeout: 245 seconds)
[16:08] * xymox (lechuck@unaffiliated/contempt) has joined #jython
[16:14] * xymox (lechuck@unaffiliated/contempt) Quit (Ping timeout: 244 seconds)
[16:15] * xymox (lechuck@unaffiliated/contempt) has joined #jython
[16:41] <whg> Anybody here using Mavericks?
[16:45] <whg> My problem is with the launcher script, as installed by homebrew (but I don't think it's patched). On one Mavericks machine, everything just works. On the other, jython fails to start with an error saying JYTHON_HOME doesn't contain the jars.
[16:45] <whg> Thoughts?
[16:45] <whg> JYTHON_HOME isn't set on either machine
[16:54] <daenney> So yeah, the launcher script with homebrew doesn't work
[16:54] <daenney> JYTHON_HOME is never automatically set for you, it's an environment variable you need to set yourself
[16:56] <daenney> You need to set your JYTHON_HOME like this: export JYTHON_HOME=/usr/local/Cellar/jython/2.7-b1/libexec
[16:56] <daenney> Substitue 2.7-b1 for 2.5.3 if you're running stable
[16:57] <daenney> Then you can simply run `jython` from the console and it will load up
[16:59] <daenney> As to why it's behaving differently on your machines I don't know, there must be a configuration difference somewhere
[17:03] <whg> daenney: Yeah, I'm trying to track that down
[17:03] <whg> I didn't expect JYTHON_HOME to be set
[17:03] <whg> the launcher script appears to do some chicanery with following links to try to figure it out
[17:03] <whg> And it appears to only work on one box
[17:03] <whg> Yet they're both running the same version of Mavericks and Jython
[17:04] <whg> I can work around it by setting JYTHON_HOME, but it's nice to not have to, especially since setting it means I need ot remember to update it if I upgrade Jython
[17:07] <daenney> I've never been able to get it to load without JYTHON_HOME is Jython was installed by Homebrew
[17:08] <daenney> I'm currently working on a new Jython Launcher which will take care of all this but until then...
[17:10] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Quit: jarekps)
[17:14] <whg> yeah???
[17:14] <whg> I'll just hack it for now
[17:15] <whg> My shell-fu is not strong enough to figure out what all the launch script is doing so I can figure why it works in one place but not the other
[17:18] <daenney> Actually, you can set JYTHON_HOME to `brew --prefix jython`/libexec
[17:18] <daenney> That's a version agnostic path, so you won't have to reset it every time you upgrade jython
[17:26] <topi`> daenney: maybe we ought to contribute a jython recipe to brew?
[17:26] <topi`> is there any already?
[17:26] <topi`> oh, there is.
[18:17] * 20WAAKLSS is now known as jimbaker
[18:25] * jimbaker (~jbaker@c-71-237-106-195.hsd1.co.comcast.net) Quit (Changing host)
[18:25] * jimbaker (~jbaker@unaffiliated/jimbaker) has joined #jython
[18:30] * paolo (~Paolo@net-37-117-35-67.cust.dsl.vodafone.it) has joined #jython
[20:32] <topi`> I did some perf testing of 2.7b1 and it seems to be quite a bit faster than CPython on pystone
[20:33] <topi`> 170k stones for cpython 2.7 and 245k stones for jython 2.7
[20:33] <topi`> though the 1st iteration was only at 80k stones
[20:34] <topi`> however, testing with a simple list comprehension like tmp = [x*2 for x in range(5000000)] was 2-3 times slower on jython
[20:34] <topi`> I don't exactly know why. Is a Java array being created to hold that list?
[20:44] <pjenvey> I'm not sure why it's much slower, assuming you're doing enough iterations, I'd narrow down the slowness a bit more
[20:44] <pjenvey> the range call and the multiply calls
[20:45] <pjenvey> oh, there's one difference here -- jython's list type does locking
[20:47] <pjenvey> vs cpython holding the GIL and probably very infrequently releasing it there (if at all), every list append acquires a lock. hotspot can elide the locking in some situations but it may not be able to 'see' through all of the jython runtime to make that optimization
[20:47] <pjenvey> invoke dynamic can help it 'see' better
[21:33] <topi`> jimbaker: this is what the "Using SSL with non-blocking IO" author says in the conclusion:
[21:33] <topi`> "Unfortunately, this is a complex API with a long and steep learning curve. But when scalability and security are not optional, this is a price developers will have to pay.
[21:34] <topi`> pjenvey: right, so we must first implement some invokedynamic magic to make the case for list comprehensions faster...
[21:34] <topi`> it's quite unfortunate that a list comprehension would acquire a lock to the list every time the "loop" inside the comprehension is incremented...
[21:35] <topi`> that operation should be done at once.
[21:37] <topi`> leo-the-manic: if you didn't already get an answer: pip will fail with jython since it requires SSL and the SSL implementation in jython 2.7 is incomplete.
[21:37] <topi`> work-in-progress...
[21:45] <leo-the-manic> topi`: Ohhh, okay
[21:45] <leo-the-manic> topi`: I found a lot of stuff about Java SSL certs last night and didn't know what to believe
[21:46] <leo-the-manic> topi`: So thanks for the info, looking forward to it
[21:50] <whg> topi`: Which list implementation is being used behind the scenese?
[22:05] <topi`> leo-the-manic: I've installed Django on jython by just using easy_install
[22:05] <topi`> so you might want to go that route
[22:05] <topi`> there were some tricks to get virtualenv properly set up, I have a (delayed) writeup about that
[22:06] <topi`> whg: I don't know, but I noticed that using a generator expresssion instead was much faster, on par with CPython
[22:10] <topi`> jimbaker: I can migrate ssl.py to use SSLEngine, but so far am not willing to fool around with Threadpools so I'll just try to create a New Thread for the task SSLEngine is handing out
[22:10] <whg> topi`: Hmm??? I was wondering if using one of the concurent list implementations might avoid the need for some of the locking
[22:11] <topi`> is there anything in jython that wraps the java.util.concurrent.newSingleThreadExecutor() ?
[22:11] <whg> topi`: But I don't know the semantics around threads and python lists well enough to say
[22:11] <topi`> whg: I thought concurrent list implementations *always* lock automatically for you...
[22:11] <topi`> and CPython just GILs any such lists because it's the only way to be 100% safe
[22:12] <leo-the-manic> topi`: Oh, really? I was also finding that pip worked properly with .tar.gz files (as long as the packages themselves didn't need ssl or bz2). The project I'm interested in moving from CPython to Jython is currently in "beta" although the number user is tiny so I have some leeway to play around, but I still might wait it out until pip etc. work reliably
[22:12] <topi`> there was an article about that
[22:12] <topi`> leo-the-manic: pip does not work because of the fact that it uses HTTPS to download packages, which requires ssl
[22:12] <whg> topi`: The concurrent collections tend to be highly clever so they can avoid the need for locks
[22:14] <whg> topi`: But I don't know if they make the same guarantees about the orders of reads/writes, etc. that Python does
[22:23] * whg is now known as zz_whg
[22:25] <pjenvey> there's not a lot of I would say appropriate for PyList concurrent, in particular, lock free List implementations
[22:26] <pjenvey> w/ structures like Maps you can.. I'd say get away with lock free algorithms a bit more without so much extra overhead
[22:26] <pjenvey> lists are really simple. granted the locking we're doing is introducing overhead, but eventually hotspot's JIT can remove it in a lot of situations
[22:27] <pjenvey> the lock free map we use doesn't add too much perf overhead but it does unfortunately add some extra memory usage
[22:27] <pjenvey> (for dict)
[22:43] <topi`> I looked up an example of how to use SSLEngine and the example was over 600 lines of java code. ugh.
[22:43] <topi`> how does java.nio.ByteBuffer differ from other buffers?
[22:44] <topi`> e.g. the MemoryView present in jython trunk


These logs were automatically created by JythonLogBot_ on irc.freenode.net using a slightly modified version of the Java IRC LogBot (github).