00:31:52  * bradleymeckquit (Quit: bradleymeck)
00:38:52  * bnoordhuisquit (Ping timeout: 264 seconds)
00:50:10  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:53:31  * enaqxjoined
00:57:45  * enaqxquit (Read error: Connection reset by peer)
00:58:12  * enaqxjoined
01:06:23  * enaqxquit (Ping timeout: 248 seconds)
01:08:47  * bradleymeckjoined
01:17:22  * bradleymeckquit (Quit: bradleymeck)
01:20:43  * jugglinmikequit (Ping timeout: 276 seconds)
01:40:58  * JoWiequit (Quit: Connection closed for inactivity)
01:43:28  * enaqxjoined
01:45:11  * bnoordhuisjoined
01:50:00  * bnoordhuisquit (Ping timeout: 256 seconds)
01:55:10  * enaqxquit (Ping timeout: 276 seconds)
01:55:45  * abraxas_joined
02:28:53  * caitpquit (Quit: My Mac has gone to sleep. ZZZzzz…)
02:34:11  * enaqxjoined
02:42:05  * enaqxquit (Read error: Connection reset by peer)
02:42:20  * enaqxjoined
03:11:28  * ofrobotsjoined
03:14:36  * ofrobotsquit (Client Quit)
03:15:07  * ofrobotsjoined
03:22:25  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
03:26:27  * ofrobotsjoined
03:31:39  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
03:35:43  * enaqxquit (Ping timeout: 248 seconds)
03:51:21  * enaqxjoined
03:52:43  * bradleymeckjoined
04:13:45  * enaqxquit (Read error: Connection reset by peer)
04:14:04  * enaqxjoined
04:19:04  * ofrobotsjoined
04:21:57  * ofrobotsquit (Client Quit)
04:43:20  * bradleymeckquit (Quit: bradleymeck)
04:58:29  * ofrobotsjoined
05:04:33  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
05:04:53  * ofrobotsjoined
05:25:46  * enaqxquit (Remote host closed the connection)
05:33:51  * bradleymeckjoined
06:06:20  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
06:08:24  * enaqxjoined
07:15:12  * mostynbjoined
07:28:03  * enaqxquit (Ping timeout: 252 seconds)
07:30:30  * enaqxjoined
07:40:42  * abraxas_quit (Remote host closed the connection)
07:47:51  * enaqxquit (Ping timeout: 252 seconds)
07:49:11  * enaqxjoined
07:53:01  * abraxas_joined
07:54:27  * enaqxquit (Ping timeout: 252 seconds)
07:57:07  * bradleymeckquit (Quit: bradleymeck)
08:17:50  * C-Manjoined
08:23:23  * bnoordhuisjoined
08:43:35  * abraxas_quit (Remote host closed the connection)
08:56:24  * abraxas_joined
09:07:25  * enaqxjoined
09:14:12  * enaqxquit (Ping timeout: 252 seconds)
09:16:12  * rendarjoined
09:18:07  * abraxas__joined
09:20:49  * abraxas_quit (Ping timeout: 264 seconds)
09:25:17  * abraxas__quit (Read error: Connection reset by peer)
09:25:30  * abraxas_joined
10:06:14  * enaqxjoined
10:17:37  * bnoordhuisquit (Ping timeout: 256 seconds)
10:24:36  * xiinotulpjoined
10:28:04  * plutoniixquit (Ping timeout: 252 seconds)
10:42:02  * bnoordhuisjoined
10:52:38  * caitpjoined
10:53:50  * abraxas_quit (Remote host closed the connection)
10:54:19  <trungl-bot>Tree closed by [email protected]: Tree is closed (maintenance)
10:56:12  * xiinotulpchanged nick to plutoniix
10:56:27  * abraxas_joined
11:12:17  * abraxas_quit (Remote host closed the connection)
11:25:29  <trungl-bot>Tree opened by [email protected]: Tree is open
11:27:31  <trungl-bot>Tree closed by [email protected]: Tree is closed (Automatic: "gclient runhooks" on http://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20debug/builds/4345 "V8 Win64 - debug" from b7795b6a3e6eba31646d94fd97b1da53b2574d2e: [email protected])
11:53:52  * esasquit (Ping timeout: 264 seconds)
11:56:43  <trungl-bot>Tree opened by [email protected]: Tree is open (Win ninja not working? Arm debug timeouts as usual)
12:09:43  * JoWiejoined
12:14:47  * bnoordhuisquit (Ping timeout: 250 seconds)
12:20:56  * bnoordhuisjoined
12:41:06  * enaqxquit (Remote host closed the connection)
12:56:20  * enaqxjoined
13:20:14  <trungl-bot>Tree opened by [email protected]: Tree is open (infra CL reverted)
13:45:06  * jugglinmikejoined
13:58:15  * ofrobotsjoined
14:00:33  * mostynbquit (Quit: Leaving)
14:00:33  <trungl-bot>Tree closed by [email protected]: Tree is closed (Automatic: "compile" on http://build.chromium.org/p/client.v8/builders/V8%20Win32%20-%20debug%20builder/builds/4984 "V8 Win32 - debug builder" from 21d64edfdf313f530dabec1fd751d9a96183508e: [email protected])
14:08:01  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
14:16:17  * ofrobotsjoined
14:21:46  <trungl-bot>Tree opened by [email protected]: Tree is open
14:49:53  * abraxas_joined
14:50:10  * bradleymeckjoined
14:54:50  * abraxas_quit (Ping timeout: 256 seconds)
15:01:24  * davijoined
15:01:34  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:20:38  * daviquit (Ping timeout: 256 seconds)
15:37:01  * ofrobotsjoined
15:42:49  * davijoined
15:51:48  * daviquit (Ping timeout: 256 seconds)
16:04:33  * RT|Chatzillaquit (Quit: ChatZilla 0.9.86.1 [Firefox 2.0.0.22pre/2009081014])
16:26:34  * C-Manquit (Quit: Connection reset by beer)
16:30:04  * bnoordhuisquit (Ping timeout: 244 seconds)
16:30:35  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:30:53  * ofrobotsjoined
16:55:39  * davijoined
16:55:39  * daviquit (Changing host)
16:55:39  * davijoined
17:36:51  * bnoordhuisjoined
17:41:19  * bnoordhuisquit (Ping timeout: 256 seconds)
17:50:25  * bnoordhuisjoined
18:06:05  * ofrobotsquit (Read error: Connection reset by peer)
18:06:37  * ofrobotsjoined
18:07:59  * enaqxquit (Remote host closed the connection)
18:18:56  * rmichnikjoined
18:27:47  * abraxas_joined
18:31:05  * daviquit (Ping timeout: 246 seconds)
18:32:53  * abraxas_quit (Ping timeout: 264 seconds)
18:48:32  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:53:00  * ofrobotsjoined
19:06:49  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:10:28  * enaqxjoined
19:15:15  * EGregjoined
19:15:20  <EGreg>hey all
19:15:28  <caitp>hi greg
19:15:32  <EGreg>how efficient are closures in v8? Should I avoid having a lot of variables in closures?
19:15:38  <EGreg>or are they as efficient as objects?
19:16:00  <caitp>the usual advice is "don't try to optimize until you need to" but
19:16:13  <EGreg>I'm guessing that each function is actually compiled once into static code, wherever it appears, but the closure is passed to it as an implicit object, and there is very little price for having 40 variables in the closure vs 1
19:16:25  <EGreg>I'd like to know how the performance is, or what really happens.
19:18:48  <bnoordhuis>EGreg: you're spot on
19:19:28  <bnoordhuis>a closure is basically a code pointer + an array for the captured free variables
19:22:48  <caitp>the "captured free variables" are the things that are most expensive to reference, especially if they're very high up in the chain
19:23:02  <caitp>but it usually doesn't matter
19:23:07  <caitp>profile =)
19:23:36  <caitp>local variables should always be basically free though
19:23:38  * ofrobotsjoined
19:24:11  <caitp>(to reference, not talking about allocation or compilation)
19:25:42  * bnoordhuisquit (Ping timeout: 256 seconds)
19:34:06  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:34:30  <EGreg>I thought so. But I was put off by worrying about some browser engines. Like Microsoft writes this:
19:34:31  <EGreg>https://msdn.microsoft.com/en-us/library/windows/apps/Hh781219.aspx
19:38:33  <EGreg>http://blogs.msdn.com/b/eternalcoding/archive/2014/08/05/javascript-using-closure-space-to-create-real-private-members.aspx
19:38:52  <EGreg>But if I use node.js then I am only using v8.
19:39:31  <caitp>I remember reading that MS made a fork of Node that uses chakra + some abstraction layer to look like v8, iirc
19:39:41  <EGreg>it seems to me that having more closure variables (flat structure) is better than having one closure object with properties (extra level of indirection)
19:40:06  <EGreg>so basically, what is more efficient? or are they roughly the same:
19:41:31  <EGreg>MyClass.construct = function() { var ret = {}; ret._foo = 4; } // pretend it's private
19:41:32  <EGreg>or
19:41:39  <EGreg>sorry I meant
19:41:55  <EGreg>MyClass.construct = function() { var ret = {}; ret._foo = 4; return ret; } // pretend it's private
19:42:18  <EGreg>MyClass.construct = function() { var _foo = 4; var ret = {}; } // pretend it's private
19:42:51  <EGreg>It seems to me that the real closures carry a cost because any methods accessing them have to be on every instance object, not just the prototype. So it consumes more memory.
19:43:02  <EGreg>I mean closures to make 'private properties'
19:43:04  <caitp>it's probably not worth worrying about making things "private"
19:43:05  <EGreg>sorry if I'm not being clear
19:43:36  <EGreg>yeah. I was just wondering whether making "private properties" via closures is as efficient as adding them to the this._private object
19:43:37  <caitp>unfortunately "private" abstractions end up being more complicated and often slower
19:44:02  <EGreg>ignoring the fact that this._private can be accessed by prototype methods and closures can't
19:44:26  <caitp>yes, that would be faster
19:44:36  <EGreg>what would?
19:44:59  <caitp>storing properties on the object vs defining getter/setters that operate on context allocated variables
19:45:09  <caitp>whether it matters or not for performance depends on the code that uses it
19:45:11  <caitp>how hot is it
19:45:27  <caitp>I mean, one may be faster than the other, but it probably doesn't matter 99% of the time
19:45:45  <caitp>so the more important thing is just how confusing is it for your other authors
19:46:12  <EGreg>right
19:46:46  <EGreg>I used closures heavily here: https://github.com/Qbix/Platform/blob/master/platform/classes/Db/Row.js
19:46:53  <EGreg>can you please take a look and critique it?
19:50:57  <caitp>well, the biggest criticism is probably the metaprogramming
19:51:44  * C-Manjoined
19:54:37  <caitp>something you'll notice is that Object.defineProperty/ies isn't particularly fast, so it's generally better to do that like once during bootup rather than every time you instantiate the object. If the object has to be instantiated often, you'll notice it
19:58:37  <caitp>i had wanted to use a strategy like that for hiding private state in the promise implementation in angularjs last year, but it had a significant impact on benchmarks because promises are created pretty frequently
19:59:10  <EGreg>oh, you work on angularjs?
19:59:29  <EGreg>Db rows are created pretty frequently
20:00:03  <caitp>might be worth looking at Mongoose's strategy
20:00:06  <EGreg>but, we don't have a way around it, we need to have hooks for getting/setting row properties, and we would like to use a familiar syntax instead of fields.setFoo and fields.getFoo
20:00:15  <caitp>I haven't been through their code in too much detail
20:00:32  <caitp>you could always just make those hooks methods
20:01:10  <EGreg>I want to be able to assign properties normally with normal syntax:
20:01:19  <EGreg>stream.fields.publisherId = 'z9878czc'
20:01:26  <EGreg>but have a hook that validates the input etc.
20:01:33  <EGreg>so I need to define getter/setter
20:02:05  <caitp>I mean I can see the appeal, but if you're creating that abstraction often, the cost will be noticeable
20:02:15  <caitp>if you don't need 60fps then go for it
20:02:51  * ofrobotsjoined
20:04:15  <EGreg>it's on the backend
20:04:16  <EGreg>node.js
20:04:54  <EGreg>a db row will be saved to the db, which the script will probably have to wait for anyway
20:05:07  <EGreg>so the only real cost is slowing down the main thread / main loop slightly
20:05:30  <caitp>there's no need for you to block during db interactions, and that is definitely not scaleable
20:06:16  <EGreg>that's not what I mean
20:06:30  <EGreg>I mean that a given request will wait until the db callback is called
20:06:57  <EGreg>and in the meantime, the only real cost can be described as the aggregate of all calls to getter/setter setup, on the main loop, as an aggregate thing
20:07:08  <EGreg>in other words each particular request would be slowed down by a negligible amount
20:07:15  <EGreg>but the main thread might be slowed down by a significant amount
20:09:02  <EGreg>I'm talking in the context of a node.js web server
20:09:16  <caitp>so, say you had to set up one of these schema objects for every single request, okay, it will take some time
20:09:19  <EGreg>a request comes in, most of the time spent serving it is I/O bound, the getter/setter hardly makes a difference in a given rquest
20:09:26  <caitp>not "forever", but a measurable amount of time
20:09:37  <EGreg>but, on a given thread / core, I might be spending 1% of the time in those getter/setters
20:09:42  <EGreg>that's where the real cost appears
20:10:01  <EGreg>in other words latency isn't affected but throughput is
20:10:10  <caitp>not enough time for your user to notice __probably__, but in order to scale it, you'd need a well load balanced cluster
20:10:25  <EGreg>yeah, latency and scalability can be orthogonal
20:10:33  <EGreg>getter/setter may be bad for scalability, not latency
20:10:40  <EGreg>that's all I meant
20:10:58  <EGreg>does it take up a lot of extra memory btw? or is it just storing a closure?
20:12:18  * bradleymeckquit (Quit: bradleymeck)
20:16:55  * abraxas_joined
20:16:59  <caitp>it's a bit hard to grok how everything is allocated and stored, but at the very least you'll have code space for each of your getters and setters, you'll have accessor info for the property, you'll have map space for the property itself, you'll probably have a few map transitions on the heap for each schema (but you'd have those anyways because you need to use a dynamic list of properties)
20:17:45  <caitp>so I mean, relative to like, a fully finished object literal { get fieldA() { doTheThing(); } set fieldA() { doTheOtherThing(); } ... etc }, it's a bit bigger
20:18:45  <caitp>but that doesn't mean "use an object literal and don't add or delete or configure properties on it ever"
20:19:07  <caitp>you might want to think about using the new "strong mode" stuff, which tries to help you make code easy for the vm to optimize
20:19:32  <caitp>https://developers.google.com/v8/experiments
20:21:32  * abraxas_quit (Ping timeout: 256 seconds)
20:21:45  <caitp>some of that has probably crept into more recent io.js releases
20:22:03  <caitp>there's still a lot left to do on it, but it's probably at the very least, a helpful guide
20:30:33  * bnoordhuisjoined
20:46:25  <EGreg>do you mean "use stricter" ?
20:47:02  <EGreg>Google SoundScript?
20:47:25  <EGreg>what is the main difference between io.js and node.js ? They are merging back to node.js right?
20:48:09  <EGreg>I just tested my front-end framework's speed. Apparently it's able to initialize 750 components in 2.8 seconds ... that's about 3 microseconds per component. I don't know if it's fast, or not. How fast does AngulerJS do it?
20:55:58  <caitp>I think it's just "use strong" now
20:56:47  * lmkmplmjoined
20:57:17  <caitp>"How fast does AngulerJS do it?" off the top of my head, I have no idea. it would depend on the components
20:57:37  <bnoordhuis>EGreg: for practical purposes, io.js is node.js-next
20:57:56  * C-Manquit (Ping timeout: 265 seconds)
20:58:07  <caitp>that stuff gets complicated very fast, did you read addy osmani's perf audit of the new reddit mobile app?
20:58:20  <caitp>not angular, just that it's relatively complicated
21:16:13  <EGreg>I've done a ton of work on my platform, started before Angular became all the rage.
21:16:34  <EGreg>Its main focus is just to have reusability, security, interoperability, scalability, resilience, etc.
21:16:56  * enaqxquit (Remote host closed the connection)
21:16:59  <EGreg>But outperforming everyone on speed wasn't a key concern. Still, I don't want it to be super slow.
21:17:10  * enaqxjoined
21:17:34  <EGreg>The way we do updates for example is that people building components are supposed to do:
21:17:56  <EGreg>component.rendering('a,b,c', function () { update the dom here } )
21:18:05  <EGreg>it could also be ['a', 'b', 'c'] or just 'a' etc.
21:18:37  <EGreg>basically the callback is scheduled to be run on the next frame ... but you have to *explicitly* tell the system that the state has changed, with component.stateChanged('a,b') for example.
21:18:46  * rendarquit (Ping timeout: 256 seconds)
21:19:13  <EGreg>instead of wasting time at run-time trying to do "magic" through dirty-checking (the model like angular, or the dom like react/mithril) it just asks the developer to explicitly say when something has changed.
21:19:40  <EGreg>after all they did just write component.state.a = 5; so they can also write component.stateChanged('a,b,c') at the end of the changes.
21:23:09  * C-Manjoined
21:24:20  * lmkmplmquit (Ping timeout: 246 seconds)
21:25:22  * rendarjoined
21:30:18  * bradleymeckjoined
21:32:51  * bnoordhuisquit (Remote host closed the connection)
21:33:16  * enaqxquit (Remote host closed the connection)
21:36:23  * bnoordhuisjoined
21:45:18  * Bob_Gneuquit (Ping timeout: 252 seconds)
21:45:33  * enaqxjoined
21:46:33  * Bob_Gneujoined
21:47:06  * bradleymeckquit (Read error: Connection reset by peer)
21:47:38  * bradleymeckjoined
21:50:48  * Bob_Gneuquit (Ping timeout: 252 seconds)
22:04:00  * enaqxquit (Remote host closed the connection)
22:18:33  * enaqxjoined
22:25:04  * enaqxquit (Ping timeout: 256 seconds)
22:26:22  * rendarquit
22:28:34  * RT|Chatzillajoined
22:32:09  * ofrobotsquit (Quit: My Mac has gone to sleep. ZZZzzz…)
22:32:49  * ofrobotsjoined
22:36:18  * ofrobotsquit (Client Quit)
22:39:57  * ofrobotsjoined
22:41:56  * ofrobotsquit (Read error: Connection reset by peer)
23:00:43  * ofrobotsjoined
23:13:30  * plutoniixquit (Ping timeout: 256 seconds)
23:17:47  * bnoordhuisquit (Ping timeout: 250 seconds)
23:22:26  * enaqxjoined
23:23:35  * bradleymeckquit (Quit: bradleymeck)
23:30:58  * plutoniixjoined