#jython IRC Log


IRC Log for 2013-10-31

Timestamps are in GMT/BST.

[0:03] <vIkSiT> ah :)
[0:04] <vIkSiT> hmm, so jython on tomcat. abysmal performance right now
[0:04] <vIkSiT> got evertyhing to work in a way
[0:04] <vIkSiT> but i'm getting 1s response times! vs 200ms on a python server
[0:32] <agronholm> jython is many things, but performant isn't one of them
[0:32] <agronholm> sadly
[0:32] <sinistersnare> agronholm: is that a fixable problem?
[0:32] <sinistersnare> im just curious
[0:32] <agronholm> maybe, but required a herculean effort
[0:33] <agronholm> jruby managed to do it
[0:33] <agronholm> *requires
[0:33] <sinistersnare> yeah that makes sense. i always hear how JRuby is really cool and fast, but wonder why they dont say the same about jython
[0:35] <agronholm> we just don't have to resources for the work it requires
[0:35] <sinistersnare> yeah that makes sense. maybe GSoC? probably wouldnt help much though. im not even a college student o.O
[0:36] <agronholm> won't help
[0:37] <agronholm> that work requires an in-depth knowledge of jython's internals that only a handful of people have
[0:37] <agronholm> and I'm not one of them
[0:37] <sinistersnare> didnt sun/oracle hire a couple of jython devs?
[0:37] <agronholm> when?
[0:37] <agronholm> and who
[0:38] <sinistersnare> i remember reading some years old news... idk my browser doesnt work right now, im going to have to reinstall my distro...
[0:47] * sinistersnare (~sinisters@pool-108-28-93-153.washdc.fios.verizon.net) Quit (Quit: Lost terminal)
[0:52] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) Quit (Quit: This computer has gone to sleep)
[1:04] * lheuer (~Adium@unaffiliated/lheuer) Quit (Quit: Leaving.)
[1:26] * zz_whg is now known as whg
[1:39] * sinistersnare (~mint@pool-108-28-93-153.washdc.fios.verizon.net) has joined #jython
[3:03] * ohumbel (~ohumbel@adsl-178-39-149-164.adslplus.ch) has joined #jython
[3:03] * Oti (~ohumbel@adsl-178-39-179-157.adslplus.ch) Quit (Ping timeout: 240 seconds)
[3:03] * ohumbel is now known as Oti
[4:32] * truk77_ (~kurt@pool-71-191-95-144.washdc.fios.verizon.net) Quit (Ping timeout: 240 seconds)
[4:34] * truk77 (~kurt@pool-173-79-153-161.washdc.fios.verizon.net) has joined #jython
[4:35] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[5:25] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) has joined #jython
[6:09] * Oti (~ohumbel@adsl-178-39-149-164.adslplus.ch) Quit (Quit: Oti)
[6:10] * ivan` (~ivan@unaffiliated/ivan/x-000001) Quit (Ping timeout: 245 seconds)
[6:12] <peke> if i remember correctly, sun first hired two jruby guys and then later also fwierzbicki to work with jython. all of them left and/or were told to leave when oracle came around.
[6:19] * ivan` (~ivan@unaffiliated/ivan/x-000001) has joined #jython
[6:54] * lheuer (~Adium@f049072244.adsl.alicedsl.de) has joined #jython
[6:54] * lheuer (~Adium@f049072244.adsl.alicedsl.de) Quit (Changing host)
[6:54] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[7:05] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) Quit (Quit: Leaving)
[7:05] * vIkSiT (~vIkSiT|2@c-71-204-168-245.hsd1.ca.comcast.net) has joined #jython
[7:05] * vIkSiT (~vIkSiT|2@c-71-204-168-245.hsd1.ca.comcast.net) Quit (Changing host)
[7:05] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) has joined #jython
[7:30] <daenney> jimbaker: It was never my intention to use distutils.spawn for anything else than to scan the path, distutils is a bit weird in different ways.
[7:32] <daenney> jimbaker: Traditionally I do daemonisation through a snippet like this: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
[7:32] <daenney> jimbaker: However, I have no idea how that would behave on Linux
[8:14] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) Quit (Quit: Leaving)
[8:58] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[9:00] * sinistersnare (~mint@pool-108-28-93-153.washdc.fios.verizon.net) Quit (Ping timeout: 264 seconds)
[10:23] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Quit: jarekps)
[10:34] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[11:06] * sinistersnare (~mint@pool-108-28-93-153.washdc.fios.verizon.net) has joined #jython
[11:53] * ivan` (~ivan@unaffiliated/ivan/x-000001) Quit (Read error: Connection reset by peer)
[11:58] * ivan` (~ivan@unaffiliated/ivan/x-000001) has joined #jython
[12:34] <agronholm> peke: I thought fwierzbicki left long before the oracle acquisition
[13:52] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Quit: jarekps)
[13:57] * Earthnail (~Earthnail@p4FFB0F32.dip0.t-ipconnect.de) has joined #jython
[13:57] <Earthnail> I have a very weird error in Jython. It checks for the instance of a Pyro4 class: isinstance(uri, Pyro4.core.URI). Turns out this method returns false. At the SAME TIME, though, type(uri) returns <class 'Pyro4.core.URI'>. How can that be??
[14:08] <agronholm> this is a python class?
[14:09] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[14:10] <Earthnail> yes
[14:10] <Earthnail> I hacked a dirty workaround for this problem right now that checks for `"core.URI" in str(type(uri))`
[14:11] <agronholm> there are sometimes such problems with java classes due to the same class being loaded in more than one classloader
[14:11] <agronholm> but dunno why it happens in python
[14:11] <agronholm> iirc jython 2.5 doesn't even support __subclasshook__
[14:11] <Earthnail> It's Jython 2.7b1
[14:11] <agronholm> hrm
[14:12] <Earthnail> Interestingly, this may depend on the Java version running Jython. I have a jython executable that I can run from the commandline using java1.6.0_65. If I run the very same executable within a software called Max/MSP that has the ability to load jython, it doesn't work anymore
[14:12] <agronholm> what if you do id(type(uri)) and id(Pyro4.core.URI)
[14:12] <Earthnail> will try
[14:15] <Earthnail> (sorry this always takes a while; gotta recompile Jython, restart said application hosting the JVM (Max/MSP)...)
[14:17] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 240 seconds)
[14:17] <Earthnail> print id(type(uri)), id(Pyro4.core.URI) ---> `2 3`
[14:17] <Earthnail> as I was surprised by such low ID numbers, I ran id(Pyro4.core.URI) on a jython console; which gives me `2`
[14:18] <agronholm> so they're not the same classes
[14:18] <Earthnail> how can that be?
[14:18] <agronholm> dunno, but that explains the isinstance() -> False
[14:18] <Earthnail> This is definitely a bug. They must be the same classes.
[14:18] <agronholm> can you make a test case out of this?
[14:18] <agronholm> hard to debug unless a developer can reproduce it
[14:20] <Earthnail> that will be extremely tricky. I can only reproduce this bug in that software "Max/MSP". It's an audio software, http://cycling74.com/products/max/, where you can embed Java code (and thus Jython). If I run jython from the command line, everything works fine.
[14:20] <Earthnail> I really don't know how to make a simple test case out of this. Therefore I'd be happy for hints on how to investigate it myself :-/
[14:21] <agronholm> I'm not sure I'm qualified to do that
[14:21] <Earthnail> hmmm. ok.
[14:21] <Earthnail> thanks a lot, still :)
[14:22] <Earthnail> Maybe you can also help me with a, hopefully simpler, question: is there an equivalent of the multiprocessing module in Jython?
[14:22] <Earthnail> By using multiprocessing, and not threading, I gain the ability to terminate a process.
[14:25] <agronholm> no multiprocessing
[14:25] <agronholm> but you can launch subprocesses
[14:26] * fwierzbicki (~Adium@99-106-170-162.lightspeed.sntcca.sbcglobal.net) has joined #jython
[14:27] <Earthnail> ok, I'll look into it. Thanks!
[15:44] * truk77 (~kurt@pool-173-79-153-161.washdc.fios.verizon.net) Quit (Ping timeout: 248 seconds)
[15:51] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) has joined #jython
[15:56] * truk77 (~kurt@pool-71-191-95-241.washdc.fios.verizon.net) has joined #jython
[16:23] * sinsnare (cddef8b0@gateway/web/freenode/ip. has joined #jython
[16:31] * sinsnare (cddef8b0@gateway/web/freenode/ip. Quit (Quit: Page closed)
[16:59] * bartelmess (~bartelmes@bas5-toronto47-845522520.dsl.bell.ca) has joined #jython
[17:06] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Quit: jarekps)
[17:07] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[17:07] <peke> Earthnail: unfotunately subprocess at last in 2.7b1 didn't support terminate() or kill() /cc agronholm
[17:08] <agronholm> oh
[17:08] <peke> agronholm: i don't remember the exact timeline of oracle acquisition and dynamic lang people leaving.
[17:08] <agronholm> does java?
[17:10] <peke> haven't checked does java support process termination. i hope it does since i would potentially need it. i'm also interested in Popen.send_signal. haven't even tested does it work, though.
[17:16] <agronholm> http://docs.oracle.com/javase/7/docs/api/java/lang/Process.html#destroy()
[17:17] <peke> agronholm: just found it too. seems to be closer to Popen.kill() than Popen.terminate()
[17:17] <agronholm> java does not support the concept of signals
[17:19] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Quit: jarekps)
[17:19] <peke> yeah, at least officially. there is sun.misc.Signal, though.
[17:20] <agronholm> that would fail on other JREs
[17:20] <peke> at least openjdk has it, afaik.
[17:21] <agronholm> because that is mostly the same as oracle's jdk
[17:21] <agronholm> and was derived from it
[17:22] <peke> i think sun.misc.Signal is already used somewhere in jython too. and the other day jimbaker was planning to use sun.misc.Unsafe.
[17:24] <peke> i'm definitely a wrong person to comment how good idea it is to use these. using them when available would follow "practicality beats purity", though.
[17:38] <jimbaker> practicality > purity. for pure jython, consult maybe jython 2.0
[17:38] <jimbaker> in the sense of being oure java etc
[17:38] <jimbaker> pure java
[17:39] <jimbaker> sun.misc.* is pretty much in every implementation. but it is possible in certain cases to provide alternatives, or in the case of signal, to simply throw an ImportError
[17:39] <peke> jimbaker: do you know what's the status of subprocess.Popen.terminate/kill/send_signal?
[17:39] <jimbaker> peke, i don't recall unfortunately
[17:39] <jimbaker> i know i looked at this a while ago
[17:42] <peke> ok. i could take a look. already forked jython bitbucker and cloned it. what was the magic needed to compile it?
[17:45] <jimbaker> simply do $ ant
[17:45] <peke> done. how to start this version?
[17:45] <Earthnail> peke: thanks for the heads up. I ended up using threads, and implemented my own event loop.
[17:45] <jimbaker> dist/bin/jython
[17:46] <peke> BUILD.txt would be nice...
[17:46] <jimbaker> i found this interesting, http://stackoverflow.com/questions/5357390/unsafe-class-in-android
[17:46] <jimbaker> re sun.misc.unsafe
[17:47] <jimbaker> peke, you mean like INSTALL, README, etc?
[17:48] <peke> yep.
[17:48] <jimbaker> sounds like a good thing to add :)
[17:48] <peke> would be the best place to have such instructions. better than wiki that's likely to be outdated.
[17:48] <jimbaker> we probably should convert to README.md, etc
[17:48] <jimbaker> peke, agreed
[17:48] <peke> or XXX.rst even.
[17:49] <jimbaker> whatever bitbucket/github supports
[17:50] <jimbaker> at this point, i tend to just use markdown, rst is of course sort of standard for python docs, so that's one arg
[17:51] <jimbaker> http://blog.bitbucket.org/2011/05/13/dress-up-your-repository-with-a-readme/
[17:51] <jimbaker> and https://github.com/github/markup
[17:51] <jimbaker> so i guess we could use rst
[17:59] <peke> yes, i've used rst both in github and bitbucket. good thing about rst is that most python people know it already. and at least i think `rst > md` in general.
[18:00] <peke> tested Popen.terminate, kill, and send_signal
[18:00] <peke> two first fail with this error: NameError: global name '_subprocess' is not defined
[18:01] <peke> send_signal for this: AttributeError: 'module' object has no attribute 'CTRL_C_EVENT'
[18:02] <peke> if i have time, i can take a look at these a bit closer. now life is getting into way.
[18:12] <peke> jimbaker: how do you think those Popen methods should work w/ jython?
[18:13] <jimbaker> peke, well they shouldn't fail in this way :)
[18:13] <peke> with cpython terminate sends TERM signal and kill send KILL on posix. on windows terminate uses win32 api directly and kill is just an alias to it.
[18:14] <jimbaker> in general, i would expect that such functionality is available under jnr
[18:14] <peke> on posix send_signal can send any signal the platform supports. on windows it only supports TERM, which is translated to terminate
[18:15] <peke> oops, on windows it also supports CTRL_C_EVENT and CTRL_BREAK_EVENT, but those require special creation time flags too.
[18:15] <peke> should jython try to work like cpython? or should it work like cpython works on windows?
[18:16] <Earthnail> how can I find which directory a script I'm running is from if os.getcwd() returns "/", and __file__ is not defined?
[18:17] <peke> the former would obviously be better, but i don't think it's possible using the standard apis. the latter would be better than the current situation.
[18:17] <peke> ok, life getting on the way again. likely for longer time this time.
[18:19] <jimbaker> peke, basically i would look at os.kill and see how that works - this should map directly against jnr. presumably subprocess is not properly doing this right now on jython
[18:20] <jimbaker> peke, re windows, i don't have the windows knowledge unfortunately. presumably we would operate like cpython on windows - jnr should be providing this mapping for us
[18:20] <jimbaker> https://github.com/jnr
[18:20] * maxb_ (~maxb@jabberwock.vm.bytemark.co.uk) has joined #jython
[18:20] <jimbaker> of course jnr fails if run under a security manager that restricts this, but that's of course what would expect
[18:26] * maxb (~maxb@jabberwock.vm.bytemark.co.uk) Quit (*.net *.split)
[18:26] * [Arfrever] (~Arfrever@apache/committer/Arfrever) Quit (*.net *.split)
[18:42] * vIkSiT (~vIkSiT|2@50-0-250-34.dedicated.static.sonic.net) has joined #jython
[18:42] * vIkSiT (~vIkSiT|2@50-0-250-34.dedicated.static.sonic.net) Quit (Changing host)
[18:42] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) has joined #jython
[18:51] <peke> jimbaker: os.kill already works w/ jython? that ought to make supporing Popen.terminate/kill/send_signal on posix pretty easy.
[19:07] <vIkSiT> hello all
[19:13] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[19:15] * paolo_ (~Paolo@net-2-36-97-216.cust.dsl.vodafone.it) has joined #jython
[19:16] * paolo_ is now known as paolo
[19:19] * [Arfrever] (~Arfrever@apache/committer/Arfrever) has joined #jython
[19:30] * Oti (~ohumbel@adsl-178-39-149-164.adslplus.ch) has joined #jython
[19:41] <jimbaker> peke, os.kill works just fine, at least on posix systems
[19:51] <pjenvey> except you don't actually have the pid on hand, if it's available at all, it's probably private on the Process object
[19:57] * cameron__ (~thereisno@27-33-1-87.tpgi.com.au) Quit (Ping timeout: 256 seconds)
[20:10] * cameron__ (~thereisno@27-33-1-87.tpgi.com.au) has joined #jython
[20:11] * [Arfreve1] (~Arfrever@minotaur.apache.org) has joined #jython
[20:11] * [Arfrever] (~Arfrever@apache/committer/Arfrever) Quit (Ping timeout: 246 seconds)
[20:17] * [Arfreve1] (~Arfrever@minotaur.apache.org) Quit (Quit: leaving)
[20:19] * [Arfrever] (~Arfrever@apache/committer/Arfrever) has joined #jython
[20:32] <peke> pjenvey: noticed Popen.pid is None. grr.
[20:32] <peke> found this SO page about getting pid of the started process in java: http://stackoverflow.com/questions/4750470/how-to-get-pid-of-process-ive-just-started-within-java-programm
[20:33] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) Quit (Quit: This computer has gone to sleep)
[20:33] <peke> on unix it is apparently avaiable as a private field, as pjenvey guessed, but on windows you need a bit more magic.
[20:42] <pjenvey> yea, doable, but rather annoying
[20:43] <pjenvey> easiest way to get the windows functions would be to add them to the jnr-posix lib
[20:44] <pjenvey> it already has some handle related functions but not the ones you'd need
[20:44] <pjenvey> posix is pretty easy to handle
[20:45] <pjenvey> peke - I think I started updating test_subprocess.py, let me know if you're hacking on this
[20:50] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Max SendQ exceeded)
[20:51] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[20:53] * bartelmess (~bartelmes@bas5-toronto47-845522520.dsl.bell.ca) Quit (Remote host closed the connection)
[20:54] * bartelmess (~bartelmes@ has joined #jython
[20:55] <peke> pjenvey: not hacking at least today. heading bed. closer to 11pm here and feeling a bit sick.
[20:57] <peke> another problem is that i know nothing about jnr beforehand. learning would be interesting but i have time/family constraints. would rather stay on python side, in there i would be much more productive.
[20:58] <jimbaker> peke, hope you feel better
[20:59] <jimbaker> jnr - https://github.com/jnr
[21:00] <jimbaker> http://blog.headius.com/2013/06/the-pain-of-broken-subprocess.html
[21:02] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Quit: Konversation terminated!)
[21:02] <peke> jnr looks like a heroic effort by jruby guys. hat tip.
[21:02] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[21:02] <jimbaker> http://www.oracle.com/technetwork/java/javase/community/jvmls2013-2013900.html - just find the links on jnr on this page
[21:02] <jimbaker> peke, yes, and it's great we can use their heroic efforts in jython as well
[21:02] <jimbaker> since we don't have their funding
[21:02] * vIkSiT (~vIkSiT|2@50-0-250-34.dedicated.static.sonic.net) has joined #jython
[21:02] * vIkSiT (~vIkSiT|2@50-0-250-34.dedicated.static.sonic.net) Quit (Changing host)
[21:02] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) has joined #jython
[21:03] * r0bby_ (~wakawaka@guifications/user/r0bby) has joined #jython
[21:04] <topi`> vIkSiT: I don't have any real benchmarks on Jython + tomcat vs. running same Django code on CPython, but my impression is that if you manage to heat up the JVM, then it doesn't lag that much behind CPython
[21:05] <topi`> vIkSiT: an entirely different issue is if you're running jython under a virtual machine (like VirtualBox), then you'll see lag, lag and more lag.
[21:05] <peke> yes, second hat tip it's jnr.posix, not org.jruby...
[21:05] <peke> obviously don't mean the package name itself but the fact it's a standalone project.
[21:06] <topi`> how did the JRuby guys manage to get such funding?
[21:06] <jimbaker> peke, yeah, really a contribution by jruby devs to the larger community
[21:07] <topi`> maybe there's a billionaire out there who's a Ruby fan and wants to help out ;)
[21:07] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 268 seconds)
[21:07] <jimbaker> topi`, i think it's in part a reflection on rails popularity? also that team of headius, enebo, and more is just fantastic
[21:08] <topi`> jimbaker: we need an all stars team on the Jython side as well ;)
[21:08] <topi`> we should try to get J.Hugunin back? :)
[21:08] <jimbaker> topi`, i think we are doing ok there, just need to get more recognition
[21:08] <enebo> You have zed now :)
[21:09] <jimbaker> jim hugunin is a johnny appleseed of software, he doesn't stay in any project for long
[21:09] <topi`> hehe
[21:09] <jimbaker> enebo, that's true, and i'm a big fan of learning python the hard way
[21:09] <jimbaker> so the python community is fine overall, more about our little pocket of jython :)
[21:10] <topi`> I'm not that much into python internals, but I can read CPython bytecode ;)
[21:10] <jimbaker> topi`, hah, well an outstanding product is to generate cpython bytecode from jython
[21:10] <jimbaker> project
[21:10] <topi`> but I don't think CPython internals matter that much to Jython, since comparing C to Java is a vain attempt
[21:11] <jimbaker> topi`, well there's certainly one huge counterexample, http://www.jyni.org/
[21:11] <topi`> and I can see Jython 2.7 is a lot less code than CPython 2.7
[21:11] <jimbaker> which works because the c extension api is really well defined
[21:11] <jimbaker> and small in scope
[21:12] <topi`> heh, JyNI is like Cython :)
[21:12] <jimbaker> topi`, it's actually even better
[21:12] <jimbaker> it lets us run any cython code
[21:13] <jimbaker> or swig, or cxx
[21:13] <jimbaker> as long as it's well behaved
[21:13] <topi`> so it uses cdef's straight out of Cython's sleeve?
[21:14] <topi`> Cython is interesting, but the only way to get perf is to type your functions extensively
[21:14] <jimbaker> topi`, you would use cython to compile .so or .dll files; but since these just need access to the ptyhon c ext api entry points, it works
[21:14] <jimbaker> with jython through jyno
[21:14] <jimbaker> jyni
[21:14] <topi`> but you'd need some kind of FFI (foreign function interface) into java, then?
[21:15] <topi`> maybe there is, I don't know much about java
[21:15] <jimbaker> so jython would not work w/ cython directly
[21:15] <topi`> have finished some chapters of the Java tutorial :)
[21:15] <jimbaker> topi`, this is jni - java native interface
[21:15] <jimbaker> it's been part of java since 1.0
[21:15] <topi`> oh, so you can link into C libraries via JNI?
[21:15] <jimbaker> topi`, correct
[21:16] <jimbaker> it's nontrivial, but if the work is done, it's easy to use
[21:16] <topi`> right
[21:16] <topi`> at some point in history, I was involved in the FFI project for GHC haskell compiler
[21:17] <topi`> there was some bits of assembly missing for the ARM platform, and I did the port. or rather, half-did...
[21:17] * maxb_ is now known as maxb
[21:17] <topi`> there weren't too many bits of assembly required, but it was *nontrivial*
[21:18] <jimbaker> topi`, yeah, jni is easier
[21:18] <topi`> I have never feared assembler, since that's how I started programming ;)
[21:18] <topi`> poking code into RAM on a commodore-64
[21:19] <jimbaker> for me, it was my third language - basic, forth, assembler, all on vic 20, then commodore 64
[21:19] <jimbaker> also trs80, apple2
[21:19] <topi`> jimbaker: do you have any status page about the upcoming 2.7b2 release? ;) I'm particularly interested in getting Requests to work
[21:19] <jimbaker> topi`, nahh...
[21:19] <jimbaker> i haven't done any such status work
[21:19] <topi`> maybe tweets?
[21:19] <jimbaker> but i will tell you right now
[21:20] <jimbaker> tweets? are you kidding?!
[21:20] <jimbaker> ;)
[21:20] <topi`> forth is cool ;) it's possible to implement a Forth interpreter in very small space
[21:20] <jimbaker> so here's the status - 2.7 beta2 is blocking on pip, which is blocking on requests - since pip trunk now uses requests
[21:20] <topi`> oh, they switched already
[21:21] <jimbaker> the way pip uses requests is blocking on nonblocking ssl client sockets
[21:21] <jimbaker> which is not yet supported, this is functionality beyond what is in jython-ssl
[21:21] <topi`> ok, so it gets interesting.. and we want to use java NIO sockets then?
[21:21] <jimbaker> well, we use java nio sockets in Lib/sockets.py
[21:22] <jimbaker> but to get those to work w ssl, we need to use SSLEngine
[21:22] <topi`> and that would mean a rework...
[21:22] <jimbaker> yes
[21:22] <jimbaker> i am glad i didn't even bother to write anything in java up until this point for this
[21:22] <topi`> I know quite a bit about how SSL works, maybe I could tackle that one
[21:22] <jimbaker> "correctness first"
[21:22] * r0bby_ (~wakawaka@guifications/user/r0bby) Quit (Read error: Connection reset by peer)
[21:23] <jimbaker> topi`, it would be awesome if you took a look on this
[21:23] <topi`> well, I've already had my fair share of problems about using sockets on jython
[21:23] <jimbaker> right now, i'm not doing any jython dev until nov 15
[21:24] <topi`> my only solution to the disappearing FDs was to switch the code to use java.net.URL instead of urllib2
[21:24] <jimbaker> because i have a workshop, two talks, not to mention my class, to prepare for between now and nov 14
[21:24] <topi`> oddly, FDs were disappearing even when I paid close attention to close all handles returned by urllib2.
[21:24] <jimbaker> topi`, yeah, i could see this happening
[21:24] <jimbaker> the sockets implementation needs some reworking, not just ssl support
[21:25] <topi`> I did peer into the urllib2 code and what gets called underneath, but was unable to clarify where the FDs ended up not being released
[21:25] <jimbaker> specifically the refcounting used by it is at the very least problematic
[21:25] <jimbaker> really should be doing weakref
[21:26] <topi`> the resources (FDs) ought to be tied to the file object being instantiated, and then __del__ ought to release the resources
[21:26] <topi`> but probably __del__ is not guaranteed on jython, at all?
[21:27] <topi`> jimbaker: if I'll find out where the culprit is, I'll send a pull request ;)
[21:27] <jimbaker> topi`, please do that!
[21:27] <topi`> jython is fertile soil for all sorts of hacking :)
[21:28] <jimbaker> topi`, i was so prepared a week ago to say something about jython 2.7 beta 2
[21:28] <jimbaker> then i hit this momentary roadblock
[21:28] <topi`> currently my time is being consumed by a customer project, with fast changing requirements, I'm using CPython
[21:28] <jimbaker> but it will be resolved, from what i can tell SSLEngine is very straightforward
[21:28] * paolo (~Paolo@net-2-36-97-216.cust.dsl.vodafone.it) Quit (Quit: Leaving)
[21:29] <topi`> jimbaker: that would be an interesting way to learn some java :)
[21:29] <topi`> in any case, maybe grokking isn't necessary, but just using the API suffices
[21:29] <jimbaker> topi`, if you're interested, here's the best reference i have found - http://www.onjava.com/pub/a/onjava/2004/11/03/ssl-nio.html
[21:30] <jimbaker> fairly old publication, but well written
[21:30] <jimbaker> i'm pretty certain that some of the handshaking stuff does require using java 7 to fully support python ssl
[21:34] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) Quit (Quit: enebo)
[21:49] * bartelmess (~bartelmes@ Quit (Quit: Linkinus - http://linkinus.com)
[21:51] <vIkSiT> topi`, ah thanks for your response..
[21:51] <vIkSiT> when you say "heat up the jvm" - how do you mean?
[21:52] <vIkSiT> should i ignore req per second response measurements for say, the first 1000 requests?
[21:52] * Earthnail (~Earthnail@p4FFB0F32.dip0.t-ipconnect.de) Quit (Remote host closed the connection)
[21:53] <topi`> jimbaker: java 7 is problematic, many OSX users like me are still stuck in Snow leopard, and Apple only ships 1.6 JVM with those
[21:54] <topi`> vIkSiT: well, the first couple of requests are slow, sometimes very slow, then it gets slicker
[21:54] <topi`> vIkSiT: read this SO thread: http://stackoverflow.com/questions/4996823/jython-django-not-ready-for-production
[21:55] <topi`> although my complaint about that guy benchmarking is that he uses 'ab' which is somewhat lousy tool for generating highly concurrent workloads
[21:57] <cameron__> also every ab result is different concurrency lol
[21:57] <topi`> he was getting >800 req/sec on a bare bones django site, that was on an Intel i7
[21:58] <cameron__> 1 is 15, 1 is 40, 1 is 50
[21:58] <cameron__> *headdesk*
[21:58] <topi`> cameron__: well, that's why we have proper tools, like Tsung
[21:59] * cameron__ is now known as thereisnospoon
[22:03] <vIkSiT> topi`, interestingly, running this benchmark on python vs jython gives a 50% better perf on jy vs py
[22:03] <vIkSiT> http://strattonbrazil.blogspot.com/2011/08/performance-gains-in-jython-252.html
[22:04] <vIkSiT> my benchamarks on tomcat/jython django hello world vs the same hello world on django..
[22:05] <vIkSiT> on the other hand, they are all 50% slower!
[22:05] <vIkSiT> so i dont get it :)
[22:17] <vIkSiT> jimbaker, all - what are some good ways to benchmark python vs jython?
[22:17] <vIkSiT> eg, what kind of code should I run?
[22:22] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) Quit (Quit: Leaving)
[22:30] * vIkSiT (~vIkSiT|2@50-0-250-34.dedicated.static.sonic.net) has joined #jython
[22:30] * vIkSiT (~vIkSiT|2@50-0-250-34.dedicated.static.sonic.net) Quit (Changing host)
[22:30] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) has joined #jython
[22:43] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) Quit (Quit: This computer has gone to sleep)
[23:03] * truk77 (~kurt@pool-71-191-95-241.washdc.fios.verizon.net) Quit (Ping timeout: 272 seconds)
[23:12] * vIkSiT (~vIkSiT|2@unaffiliated/viksit) has joined #jython
[23:14] * truk77 (~kurt@pool-71-191-132-253.washdc.fios.verizon.net) has joined #jython
[23:32] <vIkSiT> sigh. jython performance woes
[23:32] <vIkSiT> a 1x1 comparison with python. same machine class, and everything
[23:33] <vIkSiT> and with jvm base of a simple hello world application, i get 10x worse


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