00:20:58  * watildejoined
00:27:47  * watildequit (Ping timeout: 264 seconds)
00:32:39  * C-Manquit (Quit: Connection reset by beer)
01:04:57  * xaxxonjoined
01:26:04  * plutoniixjoined
01:35:30  * jugglinmikequit (Ping timeout: 250 seconds)
01:53:35  * evanlucasquit (Max SendQ exceeded)
01:54:15  * evanlucasjoined
02:00:34  * xaxxonquit (Read error: Connection reset by peer)
02:34:27  * xaxxonjoined
02:36:23  <xaxxon>wow.. is it expected that a simple javascript-only progrma would take less than 1/10 the time to run than a c++-backed version of that same program? made a loop that allocates an object and then calls a simple function that returns a property of that object. js-only: <.5s cpp-backed object: 9s+
02:36:39  <xaxxon>I guess the javascript compiler can't optimize my c++ code?
02:37:07  <caitp>it can't
02:37:25  <caitp>the backend can only optimize specific builtins that it knows a lot about
02:38:09  <xaxxon>Switching to an optimized build the numbers change drastically, but the relative difference remains the same... they're both 10x faster
02:38:38  <caitp>js backends can't optimize your C++ code
02:38:45  <xaxxon>but now it's 1s vs 0.1s yeah, that makes sense.
02:38:56  <xaxxon>so frequent calls in and out of C++ code is bad, huh?
02:39:07  <caitp>yes
02:39:27  <caitp>on the other hand, there are some pickmups
02:39:57  <xaxxon>caitp trying to benchmark using SetPrototype on already-existing objects, but I'm finding all sorts of surprises well before I'm getting anywhere near that
02:40:02  <caitp>https://twitter.com/caitp88/status/698693948441804800 << note bmeurer's reply, which is well known but not articulated in my comment
02:40:10  <caitp>the C++ code has the advantage of being faster for more diverse types
02:40:18  <caitp>not penalized for polymorphism
02:42:08  <caitp>but, js backends can still make the js code look really really good in a microbenchmark, just due to how the compiler works
02:42:15  <caitp>it can just remove all kinds of code that never gets used
02:42:19  <caitp>or evaluated
02:42:27  <caitp>the C++ compiler can't do that because it doesn't know
02:43:43  <caitp>https://www.youtube.com/watch?v=65-RbBwZQdU&hd=1 or mraleph explaining why it might just be the microbenchmark itself that's fooling you
02:47:20  <xaxxon>well, I keep asking on the mailing lists for someone to provide some sort of understanding of the performance implications of dynamically setting object prototypes.. and no one will answer my questions except someone named "jakob" who is very... uninformative with his answers. I've asked for a basic description of what types of performance implications I'd see and he said "certain things may be slow" and I asked him what types of things I should benchmark
02:47:20  <xaxxon> and he says "What you'll use"... but I'm in a situation where I'm trying to figure out what approach I want to use because going down the wrong path could be painful to revert by the time I udnerstand the problems.. so microbenchmarks are what I have :-\
02:52:25  <caitp>the most meaningful thing you can do is try this in an actual meaningful application, and benchmark the actual application
02:52:36  <caitp>in order to weigh the performance
02:52:43  <caitp>because most likely any microbenchmark you write will be meaningless
02:53:24  <caitp>most likely you won't see a 10x difference in a real app, it will be much more subtle
02:53:39  <caitp>and the C++ might even win
03:03:01  * xaxxonquit (Remote host closed the connection)
03:03:13  * xaxxonjoined
03:29:36  <xaxxon>caitp that youtube link is fun. That guy is a good speaker.
03:30:42  <xaxxon>and yeah.. my "benchmark" wasn't even mildly unoptimizable...
03:40:34  * petka____quit (Quit: Connection closed for inactivity)
04:05:10  * xaxxonquit (Read error: Connection reset by peer)
04:07:51  * plutoniixquit (Read error: Connection reset by peer)
04:11:42  * xaxxonjoined
04:52:02  * xaxxonquit (Quit: My Mac has gone to sleep. ZZZzzz…)
05:12:46  * xaxxonjoined
05:12:52  * xaxxonquit (Client Quit)
05:13:04  * xaxxonjoined
05:25:58  * watildejoined
05:31:06  * watildequit (Ping timeout: 252 seconds)
05:32:05  * plutoniixjoined
06:02:00  * evanlucasquit (Read error: Connection reset by peer)
06:02:18  * evanlucasjoined
07:16:41  * evanlucasquit (Read error: Connection reset by peer)
07:17:16  * evanlucasjoined
07:31:13  * esasquit (Read error: Connection reset by peer)
07:32:08  * evanlucasquit (Read error: Connection reset by peer)
07:32:36  * evanlucasjoined
07:39:41  * watildejoined
07:43:04  * evanlucasquit (Read error: Connection reset by peer)
07:43:04  * evanluca_joined
07:43:53  * chrisdickinsonquit (Ping timeout: 276 seconds)
07:47:20  * chrisdickinsonjoined
07:47:26  * Clintegerquit (Ping timeout: 256 seconds)
07:48:41  * watildequit (Remote host closed the connection)
07:49:47  * Clintegerjoined
07:50:54  <xaxxon>if I create an object from a functiontemplate and then set it as the prototype of another object via: o = Object.create(new CppBackedObject()); and then call o.function_only_in_cppbackedobject(); should I expect FunctionCallbackInfo.Holder() to be the CppBackedObject I created earlier? When I try to get the internalfield while calling that method, I'm getting nullptr and if I print out the address of the object (which I know can
07:50:54  <xaxxon> change, but I'm doing these things back to back), the address of Holder() is always 0x100 higher than the object created in the call to new CppBackedObject() earlier
07:54:42  <xaxxon>hrmm, maybe Im' doing something else wrong... trying to simplify the code and it's still failing
07:55:34  * JoWiejoined
07:59:53  <jochen__>you have to create CppBackedObject from C++
08:00:10  <jochen__>in the browser, you'd use document.createElement('div') as opposed to new HTMLDivElement()
08:00:58  <jochen__>if you want new HTMLDivElement to work, you need to make the function template do something on call, then, if it's a construct call, create a new CppBackedObject and return that
08:07:06  <xaxxon>I'm not sure if I don't understand you or you don't understand me. I have a function template that returns a working object. cbo=new CppBackedObject(); cbo.function_only_in_cppbackedobject(); works fine.
08:07:46  <xaxxon>it's able to look up the internalfield in my callback and get the C++ object out of the external and then call a method on that c++ object pointer
08:08:17  <xaxxon>but if I say a=Object.create(new CppBackedObject()); and say a.function_only_in_cppbackedobject(); when I try to get the internal field, I get nullptr
08:11:22  <xaxxon>I'll try a couple more things and then post code
08:17:36  <xaxxon>Here's my code that doesn't work: https://gist.github.com/xaxxon/49234d3921bacb6f4a72 It uses a library I wrote for wrapping the C++ class, but it seems to work for "normal" use. If this use case SHOULD work, then I can put together a complete repro case but I wanted to know if it should work before I went to that effort
08:20:42  <xaxxon>jochen__ if you get a second to glance at that and let me know if it should work, I'd really appreciate it :)
08:21:56  <jochen__>have you checked what type holder is?
08:22:12  <xaxxon>no. I'll do that now
08:24:46  <xaxxon>jochen__ I'm not 100% on what you mean by checking what type holder is, but I have something that takes a value and prints out every one of the IsX() boolean values of it... the only one that came back true is IsObject()
08:25:00  <xaxxon>which is the same as on the previous call that works
08:26:29  * evanluca_quit (Read error: Connection reset by peer)
08:26:43  * evanlucasjoined
08:27:53  <xaxxon>huh.. between the two calls that work, the addresses of This() and Holder() are the same
08:28:12  <xaxxon>*info.This() and *info.Holder() that is
08:30:25  <xaxxon>i guess that may not be interesting
08:30:51  * evanlucasquit (Read error: Connection reset by peer)
08:30:53  * evanluca_joined
08:36:22  <xaxxon>I just realzied I didn't know I was supposed to get the internalfield out of This or Holder (I was using Holder) so I cahnged it to This() but got no difference in behavior
08:37:50  <xaxxon>the "embedder's guide" uses holder, though so I'm guessing that's correct
08:41:42  * evanluca_quit (Read error: Connection reset by peer)
08:41:55  * evanlucasjoined
08:42:26  <xaxxon>I just changed the code to this, and it all works up until b.get_name: c->run("c = new Animal(); c.get_name(); b=Object.create(c);c.get_name(); b.get_name();");
08:43:55  <xaxxon>reading this post about what holder is: https://groups.google.com/forum/#!topic/v8-users/Axf4hF_RfZo
08:48:26  <xaxxon>do I need to use "signatures"? (I don't know what they are but I'm looking now)
08:57:45  <xaxxon>ok, I think I'm headed down the right path. I think you may have been referring to functiontemplate::setclassname before which I didn't know about and hadn't been using.
09:05:31  <xaxxon>ok, so I'm setting the classname on my functiontemplate to the c++-generated typeid name.. and I'm always getting mangled Animal for both This and Holder - both when it works and when it doesn't work.
09:06:28  <xaxxon>when I use *v8::String::Utf8Value(i,info.This()(or Holder())
09:06:49  <xaxxon>oh but maybe that's inherited through the prototype somehow?
09:13:39  * rendarjoined
09:17:08  * evanlucasquit (Read error: Connection reset by peer)
09:17:44  * evanlucasjoined
09:20:52  * plutoniixquit (Read error: Connection reset by peer)
09:25:15  <xaxxon>I'm really frickin' confused. I put a piece of data in my c++ class and set it to rand() (I didn't srand it but whatever). Each time I call my method, I get that piece of data and print it out.. it's always there and the same value. Yet the hidden field disappears .. but when it's about to fail, if I look up that value, (which it has to go through other c++ code using the internal field to get), it works
09:34:25  <xaxxon>jochen__ what the holy hell? In my functiontemplate callback that's about to fail, I call holder->get("I"); which is a getter accessor and it gets the internal field just fine to look up the value for i, but then immediately after I do that, I say v8::Local<v8::External>::Cast(holder->GetInternalField(0))->Value() and its 0x0
09:34:35  <xaxxon>I gotta go to sleep but this is killing me
09:36:28  * plutoniixjoined
09:43:56  * mostynbjoined
09:45:10  * mostynbquit (Client Quit)
09:49:44  <xaxxon>I'm gunna post this to v8 users and go to sleep
10:05:24  <xaxxon>..posted. so sad
10:10:14  * plutoniixquit (Ping timeout: 256 seconds)
10:12:45  * plutoniixjoined
10:18:44  * plutoniixquit (Ping timeout: 272 seconds)
10:35:30  * plutoniixjoined
10:37:55  * evanlucasquit (Read error: Connection reset by peer)
10:38:09  * evanlucasjoined
10:38:39  * plutoniixquit (Client Quit)
11:06:20  <xaxxon>posted full reproduction code to v8 users list...
11:07:18  * ashish0304joined
11:07:49  <xaxxon>also here: https://gist.github.com/xaxxon/4bd2abb161ea2253e68d
11:10:32  <s1w>Does anyone know if there's any good articles explaining how V8 works under the hood?
11:11:00  <xaxxon>1if it's more than a month old, it's probably out of date...
11:11:42  <s1w>Very true, but i'm after concepts more than implementation details
11:13:30  <ashish0304>While linking with statically built v8 libs I'm getting lots of errors like "undefined reference to 'std::__1::ios_base::clear(unsigned int)'". Please help.
11:15:43  <xaxxon>ashish0304 what platform?
11:16:00  <ashish0304>Android
11:16:30  <xaxxon>ashish0304 did you goolge? there seem to be results for that message
11:16:50  <xaxxon>but the short of it is you're mixing libstdc++ and libc++ most likely
11:17:10  <ashish0304>I've got suggestion like including -lstdc++, but it is of no use.
11:18:21  <xaxxon>https://github.com/xaxxon/v8-class-wrapper/blob/master/build_instructions.txt <== look towards the bottom, those are the ENV vars I set to build with libc++ on os x
11:18:43  <ashish0304>Here is my Android.mk file
11:18:47  <ashish0304>LOCAL_PATH:= $(call my-dir)
11:18:48  <ashish0304>include $(CLEAR_VARS)
11:18:48  <ashish0304>LOCAL_CPP_EXTENSION := .cpp .cc
11:18:48  <ashish0304>LOCAL_SRC_FILES = hello.cpp
11:18:48  <ashish0304>LOCAL_MODULE := hello
11:18:48  <ashish0304>LOCAL_CPP_FEATURES += exceptions
11:18:49  <ashish0304>LOCAL_C_INCLUDES := $(LOCAL_PATH)/inc/
11:18:49  <ashish0304>LOCAL_LDLIBS := -L$(LOCAL_PATH)/inc -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot
11:18:50  <ashish0304>LOCAL_CFLAGS += -std=c++11
11:18:50  <ashish0304>ifeq ($(TARGET_ARCH_ABI),x86)
11:18:51  <ashish0304>LOCAL_CFLAGS += -ffast-math -mtune=atom -mssse3 -mfpmath=sse
11:18:51  <ashish0304>endif
11:18:52  <ashish0304>include $(BUILD_EXECUTABLE)
11:19:10  <xaxxon>normally you don't paste that much to an IRC channel, you put it on a paste site and share the link
11:19:26  * C-Manjoined
11:19:28  <ashish0304>Sorry, I'm new on IRC
11:19:43  <ashish0304>Next time I'll take care of it
11:19:53  <xaxxon>I don't know anything about android.mk. but doesn't gyp generate all the build files?
11:20:34  <xaxxon>also, I don't see anywhere in what you put about using libc++
11:20:36  <ashish0304>I'm using libs on other machine and copied v8 headers and libs.
11:21:34  <xaxxon>well, something you built uses libstdc++ and something else you built used libc++
11:21:48  <xaxxon>so you need to build everything with -std=libc++
11:24:12  <ashish0304>How to make v8 with -std=libc++
11:24:44  <ashish0304>I'm using default make android_arm.release
11:31:50  <xaxxon>ashish0304 did you look at the link I posted with the ENV vars at the bottom?
11:32:27  <xaxxon>or maybe read this: https://bugs.chromium.org/p/v8/issues/detail?id=4615
11:32:42  <ashish0304>Thanks, I'll look at it!
11:50:13  <trungl-bot>Tree closed by [email protected]: Tree is closed (Automatic: "Check" on http://build.chromium.org/p/client.v8/builders/V8%20Mac64%20ASAN/builds/4705 "V8 Mac64 ASAN" from 0dfd7bcdaf38b974bdbb3f035059e5611ffc746b: [email protected],[email protected])
11:52:18  * ashish0304part ("Quit")
12:34:27  <trungl-bot>Tree opened by [email protected]: open (arm hardware support down)
13:02:06  * evanlucasquit (Read error: Connection reset by peer)
13:02:30  * evanlucasjoined
13:37:10  <xaxxon>jochen__ so it turned out in my half-asleep daze before that the object I'm given when using my C++-made object as a prototype comes in as [object object] not [object MyClass] like the working ones do... but Im' still so confused :(
13:39:55  <xaxxon>and the whole "signature" thing didn't work out since I only have one FunctionTemplate and it seems signatures require two FT's... because you have to have the signature to make the FT and have to haave the FT to make the signature
13:42:52  * evanlucasquit (Read error: Connection reset by peer)
13:43:11  * evanlucasjoined
13:45:26  <xaxxon>apparently it's Holder().GetPrototype... :-\
13:45:47  * evanlucasquit (Read error: Connection reset by peer)
13:45:57  * evanlucasjoined
13:55:26  <xaxxon>and kt is the same object... so the remaining question is, how do you know how far up to go to get the right object?
14:19:52  * jugglinmikejoined
14:34:29  * evanlucasquit (Quit: Textual IRC Client: www.textualapp.com)
15:00:53  <xaxxon>finally got all the answers... just one missing function call to FindInstanceInPrototypeChain... and that was a day's worth of work :(
15:01:00  <xaxxon>but better than 2
15:31:49  * petka____joined
15:39:37  * evanlucasjoined
15:42:54  * RT|Chatzillaquit (Quit: ChatZilla [Firefox])
16:28:32  * plutoniixjoined
16:28:34  * xiinotulpjoined
16:30:15  * xiinotulpquit (Client Quit)
17:00:40  * watildejoined
17:04:53  * plutoniixquit (Quit: จรลี จรลา)
17:12:11  * watildequit (Remote host closed the connection)
17:12:45  * watildejoined
17:41:32  * xaxxonquit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:06:36  * watilde_joined
18:10:23  * watildequit (Ping timeout: 264 seconds)
19:09:51  * JoWiequit (Quit: Connection closed for inactivity)
19:11:02  <trungl-bot>Tree closed by [email protected]: Tree is closed (Automatic: "Test262 - no variants" on http://build.chromium.org/p/client.v8/builders/V8%20Linux64%20ASAN/builds/9858 "V8 Linux64 ASAN" from 3ec141705090ef9c8f7971f07fbf8aa64a589f4e: [email protected])
19:14:02  <trungl-bot>Tree opened by [email protected]: open
19:57:00  * watilde_quit (Remote host closed the connection)
20:11:35  * esasjoined
20:48:21  * watildejoined
21:16:00  * rendarquit (Ping timeout: 252 seconds)
21:21:31  * bradleymeckjoined
21:22:37  * rendarjoined
21:35:24  * jugglinmikequit (Quit: Leaving.)
21:35:29  * jugglinmike1joined
22:26:45  * evanlucasquit (Read error: Connection reset by peer)
22:27:10  * evanlucasjoined
22:31:19  * RT|Chatzillajoined
22:48:26  * watildequit (Remote host closed the connection)
22:55:26  * bradleymeckquit (Quit: bradleymeck)
22:59:25  * evanlucasquit (Quit: Textual IRC Client: www.textualapp.com)
23:02:10  * evanlucasjoined
23:30:10  * bobmcw_joined
23:32:03  * seventhjoined
23:32:58  * rendarquit (Quit: std::lower_bound + std::less_equal *works* with a vector without duplicates!)
23:33:12  * dagobert_______joined
23:34:01  * Martijnc_joined
23:34:20  * mesch_joined
23:34:22  * Raynos_joined
23:34:32  * littledan__joined
23:37:00  * bobmcwquit (*.net *.split)
23:37:01  * Net147quit (*.net *.split)
23:37:01  * Martijncquit (*.net *.split)
23:37:01  * eseidelquit (*.net *.split)
23:37:01  * dobsonquit (*.net *.split)
23:37:01  * Raynosquit (*.net *.split)
23:37:01  * scottmgquit (*.net *.split)
23:37:01  * seththompsonquit (*.net *.split)
23:37:01  * phpnodequit (*.net *.split)
23:37:01  * littledan_quit (*.net *.split)
23:37:01  * dagobert______quit (*.net *.split)
23:37:01  * meschquit (*.net *.split)
23:37:18  * Martijnc_changed nick to Martijnc
23:37:23  * Net147joined
23:37:50  * dobsonjoined
23:38:01  * mesch_changed nick to mesch
23:43:21  * phpnodejoined
23:43:45  * seththompsonjoined
23:44:09  * scottmgjoined
23:45:40  * eseideljoined
23:45:55  * Raynos_changed nick to Raynos