[13:40] nodelog has joined the channel
[13:41] felixge: !logs
[13:41] felixge: ok
[13:41] felixge: just fixed up the bot so it will re-connect on netsplit
[13:41] felixge: sorry about the missing logs for last night :|
[13:51] emyller has joined the channel
[13:57] mahemoff_ has joined the channel
[13:57] joshbuddy_ has joined the channel
[13:58] mahemoff__ has joined the channel
[14:08] jfd has joined the channel
[14:11] kriszyp has joined the channel
[14:14] chewbranca has joined the channel
[14:15] n8o has joined the channel
[14:17] kriszyp_ has joined the channel
[14:19] micheil_mbp has joined the channel
[14:21] jed has joined the channel
[14:23] davidsklar has joined the channel
[14:34] bryanl has joined the channel
[14:38] tlynn: bug: change test/mjsunit/test-http-tls.js:63 to http_server.setSecure("X509_PEM", "", 0, "", ""); -- client hangs
[14:38] joshbuddy has joined the channel
[14:39] paulca has joined the channel
[14:54] yaroslav has joined the channel
[14:56] cloudhead has joined the channel
[15:00] micheil has joined the channel
[15:02] bronson has joined the channel
[15:11] alex-desktop has joined the channel
[15:15] steadicat has joined the channel
[15:16] mahemoff_ has joined the channel
[15:22] deanlandolt has joined the channel
[15:23] mahemoff__ has joined the channel
[15:24] davidsklar has joined the channel
[15:36] jed has joined the channel
[15:39] n8o has joined the channel
[15:53] kriszyp has joined the channel
[15:57] tjholowaychuk has joined the channel
[15:57] tjholowaychuk: why hasn't anyone gotten rid of __wrap__ yet? is anyone using it?
[15:59] binary42 has joined the channel
[16:01] jamiew has joined the channel
[16:12] rtomayko has joined the channel
[16:28] shillcock has joined the channel
[16:33] jcrosby has joined the channel
[16:36] zmoog has left the channel
[16:36] zmoog has joined the channel
[16:39] RayMorgan has joined the channel
[16:57] r11t has joined the channel
[17:01] felixge: tjholowaychuk: nobody cared I think, just submit a patch
[17:02] tjholowaychuk: aight :) just doesn't hurt to clean things up a bit
[17:06] steadicat has joined the channel
[17:12] bpot has joined the channel
[17:30] ryah: tjholowaychuk: it fixes something - what - i forget
[17:30] ryah: tjholowaychuk: __wrap__, i mean
[17:30] ryah: it used to not be there
[17:32] aguynamedben has joined the channel
[17:36] tjholowaychuk: hmm weird
[17:37] r11t has joined the channel
[17:40] blackdog`: micheil: ping
[17:51] scudco has joined the channel
[17:52] ryah: so i'm building my latest stuff on net2. because i like it.
[17:52] ryah: it needs to be made faster.
[17:52] ryah: if anyone has some free time - see if you can massage that http server
[17:56] felixge has joined the channel
[18:05] eikke has joined the channel
[18:08] konobi: ryah: there's always callgrind
[18:09] stephenlb has joined the channel
[18:11] kriszyp_ has joined the channel
[18:15] mahemoff has joined the channel
[18:15] ryah: konobi: there is a built in profiler - the results are not so clear - internal v8 stuff happens mostly
[18:16] ryah: i hope that doesn't mean that the vm is the overhead
[18:16] ryah: s/overhead/bottleneck/
[18:16] RayMorgan: ryah: do you have a test script you are running against?
[18:16] ryah: RayMorgan: http://pastie.org/800724
[18:17] RayMorgan: cool, thanks
[18:18] markwubben has joined the channel
[18:18] technoweenie has joined the channel
[18:22] isaacs has joined the channel
[18:27] lvmike has joined the channel
[18:28] lvmike has joined the channel
[18:30] isaacs_ has joined the channel
[18:33] ericflo has joined the channel
[18:37] onar_ has joined the channel
[18:38] rictic has joined the channel
[18:42] jed has joined the channel
[18:43] mahemoff_ has joined the channel
[18:44] aho has joined the channel
[18:45] RayMorgan: ryah: just tried to shove a 41369 byte HTML doc down the net2 http and got the error: TypeError: Not enough space in Buffer for string
[18:46] ryah: RayMorgan: hm. must be some bug
[18:46] ryah: RayMorgan: it's not running all the tests yet
[18:48] RayMorgan: ah
[18:49] konobi: patches welcome!
[18:49] konobi: ACTION *ducks*
[18:49] ryah: RayMorgan: it's not as far from readyness as it might appear though - i've been messing around with the data buffering and stuff
[18:50] mahemoff__ has joined the channel
[18:50] felixge: ryah: I'll play with net2 optimization now : )
[18:50] ryah: the main thing is that it's 30% slower than the main branch :/
[18:50] orlandov: any idea where the slowdown is happening?
[18:50] ryah: not really - profiling didn't pop up any clear answers
[18:50] orlandov: lame
[18:51] ryah: but i don't think there is any reason it should be slower
[18:51] ryah: it is executing a bit more js - but i doubt that is the cause
[18:51] ryah: at least i hop enot
[18:52] ryah: under the hood, in terms of byte pushing, it should be doing less
[18:52] richtaur has joined the channel
[18:52] orlandov: then again, perhaps it's not surprising that's it's slower than optimized c++
[18:53] ryah: that's not typically the reason things are slower
[18:53] ryah: if you buffer better and you do your i/o well
[18:53] ryah: that makes a big difference :)
[18:54] ryah: and i think i'm doing that in net2
[18:54] orlandov: sure, but all things being equal..
[18:54] orlandov: ie js is doing IO well, and so is the c++ code
[18:55] ryah: well the c++ for example, does a memcpy each time data comes in
[18:55] ryah: the master branch i mean
[18:55] ryah: net2 doesn't
[18:55] ryah: you just get a js refence to that
[18:56] felixge: maybe data coming was never the bottleneck for this
[18:56] felixge: (other than crazy people doing file uploads ^^)
[18:57] felixge: what about data going out, did that used to use memcpy?
[18:58] davidjrice: felixge: going to leave this running for a week as due dilligence :)
[18:58] ryah: felixge: yeah, maybe
[18:58] davidjrice: looks really good. Streaming changes from the db
[18:58] felixge: davidjrice: hah, *fingers crossed* :)
[18:58] davidjrice: it's like the future
[18:58] ryah: felixge: yeah, data going out did one possibly 2 copies
[18:58] felixge: yeah, node rocks
[18:59] ryah: now, if you're doing raw binary, it can be written directly to socket
[18:59] ryah: strings still need to be copied out
[18:59] felixge: ryah: net2 might perform much better under more realistic load (more data than "hello world" coming out)
[18:59] konobi: ryah: did you write a pack function?
[19:01] ryah: konobi: yeah
[19:01] ryah: konobi: well, an unpack function
[19:01] okito has joined the channel
[19:02] mikeal: this has nothing to do with anything productive http://azizisbored.tumblr.com/post/359964339/what-paul-said-amen-paulscheer-this-is-one
[19:02] mikeal: but it might just be the greatest thing i've ever seen, and i feel the need to share
[19:08] mrd`: Off hand, does anyone know if a function object in V8 will keep track of all variables in its definition scope, or just the ones that it might actually use?
[19:08] mrd`: E.g., the function returned by (function(x) { return function() { return null; } })("blah"); will it still hold onto "blah", even though its never used?
[19:08] mikeal: just the ones it will use
[19:09] mrd`: Okay, cool.
[19:09] mrd`: Thanks! :)
[19:09] mikeal: closures are optimized in all modern javascript interpreters
[19:09] mrd`: mikeal: Ah, good to know.
[19:09] mikeal: when they hit the JIT it inspects the function and only keeps references to the variables it's going to reference
[19:09] mrd`: mikeal: I wasn't sure if there was a way to poke into a function object and extract its environment, and thus they'd need to drag all of that along anyway or something.
[19:09] ryah: ACTION likes writing parser
[19:09] mikeal: unless you include an eval(), then it's poorly optimized and includes a reference to the entire definition scope
[19:11] orlandov: does v8 jit? i thought it just created inline asm?
[19:11] mikeal: it inlines functions, which is good and bad
[19:11] mikeal: it's really fast for simple functions
[19:12] mikeal: but when they get complex, like if you have some closure stuff that referenced in a loop
[19:12] mikeal: the overhead of managing it inline isn't worth the optimization
[19:12] mikeal: i don't remember if they removed it for those cases or not
[19:12] mikeal: i kind of stopped following it really closely
[19:14] felixge: ryah: I get "TypeError: undefined is not a function" when trying to run the net2 benchmark code you pasted
[19:14] felixge: process.IOWatcher seems to be undefined
[19:14] orlandov: mikeal: so i found a way to do a bunch of single inserts w/ my mongo driver, but in the process found a pretty horrible bug that affects concurrency
[19:15] mikeal: a bug in MongoDB ?
[19:15] orlandov: mikeal: no in my implementation
[19:15] orlandov: but in anycase, here's how i'd do it: http://gist.github.com/289028
[19:16] felixge: orlandov: any reason you use mjsunit over assert?
[19:16] mikeal: ah, but this requires that you kill the connection after every insert
[19:16] orlandov: felixge: not at all, i thought that was the defacto library
[19:16] felixge: damn, we need to rename the unit test folder ; )
[19:16] orlandov: mikeal: no... why?
[19:16] mikeal: it looks like you do
[19:16] felixge: orlandov: it was the standard, but now the assert module is
[19:16] mikeal: oh, nevermind, i read that wrong
[19:17] orlandov: felixge: oh good :) well i'm glad someone told me
[19:17] mikeal: felixge: process.nextTick won't return until flush() is called?
[19:17] felixge: orlandov: anyway, so your idea is to avoid the blocking-ness of the mongo-client lib by spreading out the blocking calls?
[19:17] orlandov: felixge: pretty much
[19:18] orlandov: if i had to do a bunch of inserts, i'd do an insert batch though
[19:18] orlandov: this is just to see how fast you can do a bunch of one offs
[19:18] felixge: mikeal: nextTick won't execute its callback until there is no more JS to execute
[19:18] ryah: felixge: you have to use the net2 branch
[19:18] felixge: ryah: I'm using net2
[19:18] felixge: and I re-compiled
[19:18] ryah: maybe reconfigure
[19:18] mikeal: i see
[19:18] felixge: ryah: I did that as well
[19:18] mikeal: this won't work concurrently tho
[19:18] felixge: weird
[19:19] felixge: ryah: I started with 'make distclean'
[19:19] ryah: felixge: hm
[19:19] mikeal: is there a way to create new processes
[19:19] felixge: should I have used 'make clean' instead? What's the diff?
[19:19] ryah: felixge: make distclean deletes everything
[19:19] ryah: (including the libv8.a)
[19:19] ryah: um
[19:20] felixge: I'll try re-compiling again
[19:21] ryah: felixge: grep net2 wscript
[19:21] felixge: src/node_net2.cc
[19:21] ryah: grep io_watcher wscript
[19:21] felixge: src/node_io_watcher.cc
[19:21] ryah: :/
[19:21] felixge: no good?
[19:22] ryah: that's how it should be
[19:22] ryah: (are you using the installed node instead of ./node?)
[19:22] fictorial has joined the channel
[19:23] orlandov: mikeal: you could create concurrency by spaning off a bunch of mongo connections
[19:23] orlandov: but concurrency is busted right now so i'd hold off
[19:23] mikeal: hehe
[19:23] orlandov: *spawning
[19:23] mikeal: the nextTick check won't work if i have multiple connections in the same process
[19:24] mikeal: because what I want is the average write time
[19:24] orlandov: i don't know how one would measure that without a indication from the server
[19:24] mikeal: but that's alright, if concurrency was working then I could do some other tricks to figure it out
[19:25] mikeal: I can do count()
[19:25] mikeal: and I can do nextTick() to get the number that I *think* there are
[19:25] mikeal: and that should tell me how many are actually in memory and indexed compared to the number that are being buffered
[19:27] mahemoff_ has joined the channel
[19:27] felixge: ryah: I'm using ./node
[19:27] felixge: ryah: I did the build using 'sudo make'
[19:27] felixge: ryah: no make install
[19:29] mrd`: Is there an authoritative copy of fu.js?
[19:30] ryah: mrd`: are people even using that? it's it total shit?
[19:30] ryah: mrd`: it's in node-chat
[19:31] mrd`: ryah: I used it as a starting point to port some simple webapp to node.js last night.
[19:33] felixge: mrd`: you might find this useful: http://github.com/felixge/node-comment - it has a fairly simple long-polling setup (it does even use couchdb for persistence)
[19:33] mikeal: why long poll?
[19:33] mikeal: _changes has a continuous feed
[19:34] felixge: mikeal: how do you access that from a browser client?
[19:34] mikeal: http://github.com/mikeal/relaximation/blob/master/couchdb_changes.js
[19:34] mikeal: in Safari, Chrome, and Firefox you use xhr.readyState
[19:34] felixge: mikeal: I'm not long-polling on the /_changes stream - that's done with the continous mode
[19:34] mikeal: http://github.com/mikeal/jquery.couch.js/blob/master/jquery.couch.js#L161
[19:34] mrd`: felixge: Cool, thanks.
[19:35] mrd`: (I actually haven't implemented any long poll functionality yet; right now I'm just using the same once-a-second polling that my Django prototype used.)
[19:35] mikeal: although that jquery code may have broken with some of the latest changes to the continuos feed if you're running CouchDB trunk
[19:36] felixge: mikeal: that doesn't look cross-browser, is it?
[19:36] mikeal: everybody but IE
[19:36] mikeal: that's when you fall back to long poll
[19:37] binary42 has joined the channel
[19:37] felixge: mikeal: does it do that automatically ?
[19:37] blackdog`: mikeal: where did you post the test cases and bug report for childProcess?
[19:37] mikeal: my jquery plugin will eventually
[19:38] felixge: mikeal: that's really cool. Thanks, I didn't know this was supported that well
[19:38] mikeal: i first mentioned it on the list, and then I sent the testcase diff to ryah directly
[19:38] felixge: I'll certainly use that in addition to long-polling
[19:38] blackdog`: ok, i was looking on github
[19:38] mikeal: i might have pushed it
[19:38] mikeal: hold on
[19:39] felixge: mikeal: what's relaxination ?
[19:39] felixge: * relaximation
[19:39] mikeal: that's a dumping ground for stuff I'm working related to CouchDB testing and automation
[19:39] mikeal: don't follow it, it's not consistent
[19:39] mikeal: anything worth using will get broken out in to it's own repo
[19:40] mikeal: blackdog`: my github master has the changes http://github.com/mikeal/node
[19:40] mikeal: i can also send you the diff if you like
[19:42] mikeal: this is the test http://github.com/mikeal/node/blob/master/test/mjsunit/test-stdio.js
[19:55] joshbuddy has joined the channel
[19:58] jfd: Get a "thread.error: can't start new thread" when ./configure on my ubuntu 9.X server. Seems to python related "checkouts/node/tools/waf-light", line 153, in ". Im on MASTER.
[20:02] felixge: ryah: got net2 running, but the results are fairly inconsistent in osx. Will have to play with it in the VM over the weekend
[20:08] RayMorgan: I get pretty varying results for both net and net2 on OSX.. but the range seems to be that net2 is about 10% slower atm
[20:09] felixge: RayMorgan: I think we shouldn't use osx for benchmarking : )
[20:09] RayMorgan: agree
[20:15] blackdog`: micheil: you fixed the problem in your branch?
[20:16] mikeal has joined the channel
[20:32] isaacs: ryah: this is me bugging you daily to merge in my http header changes.
[20:33] isaacs: http://github.com/isaacs/node/tree/jsgi-header-fast
[20:34] gwoo has joined the channel
[20:36] cloudhead_ has joined the channel
[20:47] tlynn: ryah: bug: change test/mjsunit/test-http-tls.js:63 to http_server.setSecure("X509_PEM", "", 0, "", ""); -- https client hangs
[20:50] felixge: ryah: when you're done with isaacs bugging you, I call dips on bugging you next about merging my multipart patch :)
[21:04] eikke has joined the channel
[21:20] pmuellr has left the channel
[21:23] ayo has joined the channel
[21:29] joshbuddy has joined the channel
[21:34] rolfb has joined the channel
[21:36] jed has joined the channel
[21:39] felixge: ryah: what was the async mysql lib you were looking at for node?
[21:40] joshbuddy_ has joined the channel
[21:44] charlenopires has joined the channel
[21:48] BBBB has joined the channel
[21:48] joshbuddy_ has joined the channel
[21:49] jfd has joined the channel
[21:50] micheil_mbp has joined the channel
[21:56] jed has joined the channel
[21:57] RayMorgan: felixge: mysac - but looks like the site is down... http://cv.arpalert.org/page.sh?mysac
[21:57] felixge: RayMorgan: yeah, seems like there is no mirror to it either
[21:57] felixge: google cache is also pointing to the down-version of the site
[21:57] felixge: :(
[22:03] jed: isaacs: jetski, eh?
[22:04] isaacs: yeah
[22:04] isaacs: it's like jsgi
[22:04] isaacs: but a stream
[22:04] isaacs: so it goes fast.
[22:04] jed: aaaaaah, i get it.
[22:04] mikeal has joined the channel
[22:04] deanlandolt: you kids and your creative names
[22:04] jed: what kind of stuff are you planning first?
[22:05] deanlandolt: i like my names as stodgy acronyms :P
[22:05] RayMorgan_ has joined the channel
[22:06] deanlandolt: (not cool initialisms like find and bind)
[22:06] jed: deanlandolt: (i like how you worked the parens in there too)
[22:06] isaacs: konobi: thanks :)
[22:06] isaacs: konobi: (i take it your'e konobi on joyent?)
[22:07] konobi: isaacs: hehe... indeed
[22:07] r11t has joined the channel
[22:07] isaacs: jed: my first step is to make streaming JSGI settle a bit.
[22:07] isaacs: (see commonjs for the action there)
[22:08] konobi: isaacs: #smartplatform too
[22:08] jed: sure sure. that's a good goal.
[22:08] isaacs: jed: next step is to start porting the middleware from Jack
[22:08] rtomayko has joined the channel
[22:09] jed: isaacs: cool. i guess there are about 20 or so there?
[22:09] isaacs: yep
[22:09] isaacs: lots of good generic stuff. and may as well copy the patterns, since they're working.
[22:12] derek__ has joined the channel
[22:16] jed: isaacs: in addition to jetski, i think it'd be nice to have a wiki-style list.
[22:17] jed: like the way node has with modules, etc.
[22:18] orlandov: ugh... race conditions ftl
[22:21] mikeal: is there a uuid library for node?
[22:21] brandon_beacher has joined the channel
[22:21] mikeal: actually, any commonjs one would work
[22:23] orlandov: konobi: so that riak client you posted will be available in a week or two, according to the author
[22:23] konobi: nice
[22:23] felixge: mikeal: do you need standard-conform uuids?
[22:23] mikeal: eventually but right now I would settle for less
[22:23] konobi: isaacs: ping?
[22:23] felixge: mikeal: http://ajaxian.com/archives/uuid-generator-in-javascript
[22:24] felixge: are standards conform
[22:24] felixge: mikeal: personally I hate uuids with dashes, so I'm using this: https://gist.github.com/868088a9dc2494e4a607
[22:27] mikeal: this seems to be the latest http://www.broofa.com/Tools/Math.uuid.js
[22:27] isaacs: konobi: here
[22:29] felixge: mikeal: yeah, it shows why I don't like the uuid spec. It makes something very simple look complicated : )
[22:30] isaacs: jed: what do you mean by "wiki-style list"?
[22:30] isaacs: you mean, of middlewares?
[22:30] jed: yeah.
[22:30] isaacs: i see, yeah, that'd be coo
[22:30] isaacs: i'd also like to mock django a bit, and do stuff like jetski-blah and jetski-foo and then have a consistent module installation pattern that'd gel with npm
[22:30] jed: i love jack/narwhal, but think it would have been adopted faster if it were more decentralized.
[22:31] orlandov: ryah: does it matter if Object::Unwrap<...>(...) happens before or after HandleScope?
[22:31] orlandov: noticed you have the Unwrap before HandleScope but i'm wondering if it is significant
[22:31] jed: (i'm a fan of the jQuery approach to plugins)
[22:32] jcrosby has joined the channel
[22:32] deanlandolt: ( jed ) ( "isn't that obvious?" )
[22:33] jed: deanlandolt: touche!
[22:34] felixge: orlandov: I think any v8 stuff should happen after HandleScope, but that's just the rule of thumb I heard ryah mention once
[22:34] alexiskander has joined the channel
[22:34] felixge: orlandov: not sure if it applies here
[22:34] orlandov: felixge: that was my understanding too...
[22:34] felixge: orlandov: btw. your mongo driver has been a good resource for me. I played a little with integrating libdrizzle tonight. Didn't get very far, but your code helped me get up to speed : )
[22:35] orlandov: a lot of this stuff in indistinguishable from magic for me at this point, hehe ;)
[22:35] orlandov: felixge: you have ryah's node_postgres to thank for that
[22:35] felixge: (I know ryah wants MySAC bindings, but since I can't get a mirror for that I decided to play with libdrizzle for fun)
[22:35] davidsklar: orlandov / felixge: i am a v8 novice, but isn't the HandleScope just required to precede any operations that create handles?
[22:35] felixge: orlandov: well, your code helped because you're including a 3rd party lib. I'm a big C/C++ noob so I needed some handholding with the config there :)
[22:36] orlandov: heh i'm in the same boat
[22:36] orlandov: if i had a nickle for every segfault...
[22:36] felixge: orlandov: oh I wish my code would even compile most of the time :)
[22:37] felixge: orlandov: all I know about segfaults is that gdb can be pretty helpful debugging
[22:37] felixge: but I guess you're already familiar with that :)
[22:38] derek__ has joined the channel
[22:39] alex-desktop has joined the channel
[22:40] _Ray_ has joined the channel
[22:41] _Ray_: How could I eval some JS inside a clean sandbox? (With an entirely new scope, and which doesn't pollute/have access to the current one). process.compile still uses my same scope
[22:41] orlandov: felixge: yeah, i've been getting re-acquainted with gdb
[22:43] isaacs: _Ray_: kick off a child process, maybe, and then communicate with it via ipc?
[22:43] felixge: _Ray_: process.compile() shares the global scope, not the local one
[22:44] _Ray_: I tried forking a process, but if I want to eval '1', the return value won't be printed to console(because I'm not telling it to). eval('1') is 1, but forking the v8 shell and telling it to eval '1' will produce no output
[22:44] felixge: _Ray_: you could create a 2nd v8 context (not sure what they call it)
[22:45] felixge: but that shouldn't be too hard
[22:45] felixge: there would be absolutely no way for that script context to access node functionality
[22:46] _Ray_: However, is the reverse true? Can I access this functionality from node?
[22:46] felixge: _Ray_: you can execute the script and get the return value. But if you want to further communicate with this context, you'll have to build your own stuff for it
[22:46] isaacs: _Ray_: it seems your options are: a) process.compile, which shares the global space, but not the local scope (unlike eval, which shares the local space, too), b) fork a process, communicate over stdio with the child process, and do it that way, or c) dust off your C++ skills and write a compiled node module that uses v8 to do this.
[22:47] isaacs: afaik, there's no way in node to do quite what you're asking for.
[22:47] _Ray_: felixge, but the return value of v8 -e '43' isn't 42, how could I get '42' back?
[22:48] felixge: _Ray_: no, I'm not talking about the v8 shell, I'm talking about using the V8 C++ API
[22:48] _Ray_: ah, ok
[22:48] isaacs: also, unless things have changed since i played with it, you can't actually pass object handles back and forth across contexts.
[22:48] _Ray_: Well, I'm only interested in string representations
[22:48] isaacs: so you'd have to do something with json strings or something.
[22:49] _Ray_: Are there any docs on how to write a compiled node module?
[22:49] isaacs: _Ray_: so, you can do this with ipc, actually.
[22:49] orlandov: this is a long shot, but is there any way to know when a JS object goes out of scope?
[22:49] isaacs: orlandov: in js? no.
[22:49] orlandov: crud
[22:49] isaacs: orlandov: in c++, i believe you can get at that.
[22:49] _Ray_: isaacs, with IPC? How?
[22:50] isaacs: _Ray_: write a node program that opens stdin, reads it until it closes, evals it, and prints the JSON.stringified result to stdout.
[22:50] mikeal: hrm....
[22:50] mikeal: Error: Cannot find module 'events'
[22:50] isaacs: mikeal: update and rebuild.
[22:50] mikeal: are the docs out of date with the latest ry/tree/master/HEAD
[22:50] mikeal: i just did a minute ago
[22:51] isaacs: _Ray_: then, your main program forks a child process that runs this program, writes to its stdin, reads from its stdout, JSON.parses the string.
[22:51] mikeal: oh dammit
[22:51] mikeal: my bad
[22:51] _Ray_: ACTION thinks
[22:51] isaacs: mikeal: i was JUST about to say worksforme!
[22:54] pmuellr has joined the channel
[22:56] jcrosby has joined the channel
[23:00] achew22 has joined the channel
[23:01] achew22 has left the channel
[23:01] achew22 has joined the channel
[23:01] achew22 has left the channel
[23:01] achew22 has joined the channel
[23:14] dekz has joined the channel
[23:14] inimino: _Ray_: you can use Web Workers for that, though there's no stable support for them in node just yet
[23:14] inimino: _Ray_: there's at least one unstable implementation around last I heard
[23:16] mikeal: how do I get a childProcess to use a different cwd?
[23:16] mikeal: i tried using ENV={cwd:'/path'}
[23:16] mikeal: but that didn't work
[23:16] inimino: that just puts an "cwd" environment variable
[23:17] inimino: mikeal: there should be a chdir method somewhere
[23:17] mikeal: yeah, that's what i figured out
[23:17] beppu has joined the channel
[23:17] mikeal: i don't want to change my current procces working directory, i only want the childProcess to change
[23:19] inimino: well, the child process will inherit the directory, so you either have to get the child process to change it
[23:19] inimino: or you have to change it before you create the child process
[23:19] RayMorgan has joined the channel
[23:20] mikeal: yeah, that opens me up to lots of side effects if I'm doing anything concurrently
[23:20] inimino: I don't know how child processes are spawned...
[23:20] inimino: in node
[23:20] inimino: what should happen is that you fork, chdir, and then execve
[23:20] inimino: mikeal: maybe you can add something to the createProcess API that does that
[23:20] aurynn has joined the channel
[23:21] mrd`: Is string concatenation cheap in V8? I'm accustomed to the Python idiom of building an array of string chunks, and then concatenating them all at the end. (Or better, the Erlang convention of just returning the array, and letting the caller concat only if it really needs it.)
[23:21] aurynn: right, I was working on node.js stuff once :)
[23:21] mikeal: mrd`: javascript is good at strings :)
[23:21] mikeal: it kinda has to be
[23:21] stevestmartin has joined the channel
[23:22] inimino: mrd`: I haven't benchmarked it in V8
[23:22] mrd`: mikeal: Still, I'd think it's easier to extend an array by one element at a time, than need to append an entire string to an existing one, unless it's actually clever about it behind the scenes.
[23:22] inimino: mrd`: it's probably somewhat clever about it, but the array is probably still faster, as it is in almost every other engine
[23:22] mikeal: i'm not sure which is faster, but that assumes arrays are as optimized as strings
[23:23] inimino: mrd`: but if you need to know, benchmark it :)
[23:23] mikeal: yeah, i would just benchmark it if you really need to know
[23:24] mikeal: personally, i would just do whatever makes the code look better
[23:25] mrd`: I found http://jsbin.com/ivako; Concatenation with plus is much faster than using a StringBuffer for me in Chrome.
[23:26] RayMorgan: Array.join is slower than plain string concat in V8
[23:26] mrd`: RayMorgan: Why?
[23:26] RayMorgan: they optimize the heck out of string concat
[23:27] inimino: it may depend on some other factors like the number of strings and the lengths also
[23:28] inimino: anyway, if it really does matter, you can probably benchmark it in your actual app in a few minutes
[23:28] RayMorgan: V8 doesn't copy strings when doing string concat, they push it to a buffer, and when the buffer fills they link it to another buffer. Once you need the total result they then join it in a new buffer
[23:28] inimino: RayMorgan: interesting
[23:29] inimino: RayMorgan: so it's zero-copy until read
[23:29] inimino: and no allocation
[23:29] RayMorgan: as far as I can tell, yes
[23:29] inimino: nifty :)
[23:36] r11t has joined the channel
[23:37] mrd`: Neat.
[23:50] steadicat has joined the channel
[23:53] mrd`: Okay, it's sad though that building an arary of strings, and then looping over that array with "acc = ''; for (i = 0, N = buf.length; i < N; ++i) acc += buf[i]" is faster than just calling buf.join('') or ''.concat.apply('', buf).
[23:55] mrd`: *array
[23:59] chewbranca has joined the channel