Show enters and exits. Hide enters and exits.
| 00:59:41 | rue | slava: I hear swine flu spreads through bindings.. |
| 02:27:28 | evan | anyone who commits a primitive without a body is going to get a slap in the face |
| 03:47:44 | rue | Awesome |
| 03:54:02 | slava | evan: so I made some more progress on PICs, there are performance gains |
| 03:54:23 | slava | evan: for some reason the compiler is the main beneficiary - I guess there's a lot of polymorphism when traversing IRs etc |
| 03:55:10 | brixen | that would be true for us |
| 03:55:37 | brixen | a bunch of classes that have eg #bytecode method |
| 03:57:56 | slava | evan: a bootstrap takes 3 minutes, down from 4 |
| 03:58:04 | slava | that's the biggest single gain I'v seen so far (25%) |
| 03:58:07 | evan | nice |
| 03:58:20 | slava | also it looks like 1/10 MIC call sites become PICs |
| 03:58:23 | slava | so perhaps PICs are worth it |
| 03:59:31 | evan | very cool |
| 06:33:51 | slava | evan: ping |
| 07:27:33 | evan | slava: sup? |
| 07:49:23 | slava | evan: how does rubinius determine the class of an instance for dispatch purposes? |
| 07:49:55 | evan | it's in the object's header |
| 07:50:07 | slava | but an oop might be a fixnum right? |
| 07:50:22 | evan | oh |
| 07:50:24 | evan | gotcha |
| 07:50:29 | evan | so |
| 07:50:31 | slava | given an oop, what is its direct class |
| 07:50:37 | evan | it uses a table |
| 07:50:51 | evan | well, a branch and a table |
| 07:50:52 | evan | for fixnum |
| 07:50:56 | slava | what's the table? |
| 07:51:04 | evan | the other side of the branch pulls the class out of the oop |
| 07:51:12 | slava | the table maps tags to classes for immediate data? |
| 07:51:14 | evan | the table is the unique bit patterns |
| 07:51:20 | slava | gotcha |
| 07:51:32 | evan | it's the lowest like 6 bits or something |
| 07:51:32 | slava | so here's the deal |
| 07:51:39 | slava | 6 bits? that's a lot |
| 07:51:40 | evan | so to find the class of an immediate |
| 07:51:50 | evan | you mask the oop to find the index |
| 07:51:52 | slava | all heap objects are aligned on 2^6 byte boundaries? |
| 07:51:53 | evan | it might not be 6 |
| 07:51:56 | evan | i don't recall |
| 07:52:20 | slava | anyway, if you make it so that fixnum is the only special tag, and it has tag 0, and everything else gets the class pointer from the oop's header, its possible to do this branchlessly |
| 07:52:25 | slava | in 5 instructions or so |
| 07:53:13 | slava | this could speed up dispatch a lot because its a piece of code that's executed on each method call |
| 07:53:29 | slava | whether or not it is cached in an IC, you have to check if the class matches the cached class |
| 07:53:42 | evan | yep |
| 07:53:48 | slava | suppose you have 1 bit tags |
| 07:53:49 | evan | i've tweaked it so, not a lot |
| 07:53:55 | evan | i don't |
| 07:53:58 | slava | tag 0 means fixnum, tag 1 means its an oop and the class is in the header |
| 07:54:02 | evan | there are a number of tags |
| 07:54:07 | slava | "suppose" :) |
| 07:54:32 | slava | in this magical world with 1 bit tags and unicorns, you have a sequence of asm instructions: |
| 07:54:40 | evan | heh |
| 07:54:42 | slava | suppose your tagged oop is in eax |
| 07:54:49 | evan | k |
| 07:54:50 | slava | test eax,$1 |
| 07:55:13 | slava | mov ecx,global_variable_holding_fixnum_class_oop |
| 07:55:29 | slava | cmovnz ecx,eax |
| 07:55:46 | slava | mov edx,(ecx) |
| 07:55:54 | slava | and now your class is in edx |
| 07:56:03 | slava | evan: multi-bit tags are not a win |
| 07:56:21 | evan | so |
| 07:56:26 | slava | that's 4 instructions, followed by a cmp and je |
| 07:56:28 | slava | and that's your MIC |
| 07:56:28 | evan | word on the street is that cmovnz is slower than a branch |
| 07:56:39 | evan | because it's an internal branch that the microcode can't see |
| 07:56:42 | evan | and thus can't predict on |
| 07:56:53 | slava | the thing that gets predicted here is the je at the end of the inline cache |
| 07:56:56 | evan | cmov in general |
| 07:57:04 | slava | the code leading up to it is irrelevant, as long as it has no branches itself |
| 07:57:31 | slava | it will start executing the IC target before it finishes computing the class pointer anyway :) |
| 07:57:37 | evan | i'd be interested if the cmov is faster or if a branch is |
| 07:57:44 | evan | i was just reading that cmov takes more cycles |
| 07:57:53 | evan | and can't be predicted on |
| 07:58:34 | slava | but the thing is, you're going to load a value from memory in any case |
| 07:59:08 | slava | scalar integer ops are virtually free these days |
| 07:59:19 | slava | so removing a conditional branch seems like a win to me :) |
| 07:59:22 | evan | so why do you care about the branch then |
| 07:59:24 | slava | but I'll implement this approach and benchmark it |
| 07:59:26 | evan | if it's the memory move that takes all the time |
| 07:59:45 | slava | but if its an object that gets dispatched on it will be in cache |
| 08:00:04 | slava | also the cmove is a win if the branch is not well predicted |
| 08:00:08 | slava | suppose you have a PIC |
| 08:00:12 | slava | with two classes in it |
| 08:00:16 | slava | one of them is the fixnum class |
| 08:00:23 | slava | then the conditional will not be well predicted |
| 08:00:36 | slava | but it will still be cheaper than the indirect jump for a general method dispatch |
| 08:00:40 | evan | so you're saying that because cmov can't be predicted, it's better? |
| 08:00:47 | slava | especially if getting the class pointer is cheaper because of the cmov |
| 08:02:37 | slava | evan: I think the main benfit of conditional move these days is that it lets the CPU continue prefetching and decoding instructions |
| 08:02:45 | slava | evan: and for branches that can't be predicted well |
| 08:03:07 | evan | i guess thats true |
| 08:03:55 | slava | have you looked at the assembly that gcc generates for your dispatch code? |
| 08:04:03 | evan | yeah |
| 08:04:06 | evan | on and off |
| 08:04:17 | slava | I toyed with the idea of doing method dispatch with C code, for about two days this week |
| 08:06:06 | slava | I ended up redoing part of it in assembly |
| 08:06:50 | slava | evan: so inline caching in general doesn't help at as many call sites as I'd like |
| 08:07:11 | slava | I didn't realize it would be important to make the slow path fast too :) |
| 08:07:18 | evan | :D |
| 17:39:54 | brixen | evan: you mentioned removing Visibility, what was your idea for that? |
| 17:43:57 | evan | I did? |
| 17:44:17 | brixen | hmm I thought you did |
| 17:44:54 | evan | you mean Visibility the object that tracks public/private of a method? |
| 17:45:06 | brixen | yes |
| 17:45:11 | evan | well |
| 17:45:29 | evan | i have considered making MethodTable a standalone class, not a subclass |
| 17:45:39 | brixen | ok |
| 17:45:45 | evan | and then it's bucket could have the visibility embedded in it |
| 17:45:51 | evan | and typed specificly to Executable |
| 17:45:58 | brixen | here's the issue I'm trying to work out.. |
| 17:46:10 | brixen | see kernel/common/module.rb : 393 |
| 17:46:22 | brixen | it puts a Vis instance in with a nil @method attr |
| 17:46:32 | brixen | that messes up undef_method |
| 17:46:46 | brixen | still working out builder + rake issues |
| 17:47:07 | evan | ah |
| 17:47:08 | brixen | so rake includes FileUtils, then builder tries to undef them all in BlankSlate |
| 17:47:30 | brixen | undef_method hits the Vis instance with a nil method and thinks there is no method |
| 17:47:42 | brixen | it's all a big nest of nonsense to me :) |
| 17:47:58 | evan | heh |
| 17:48:04 | evan | well, undef_method could be smarter |
| 17:48:15 | brixen | seems there has to be a better way to track visibility |
| 17:48:27 | brixen | yeah, I can fix undef_method |
| 17:48:36 | evan | but I think the real solution is to fix MethodTable to have the bucket be [name, executable, vis] |
| 17:48:38 | brixen | but looking at it all was a big ugh reaction |
| 17:48:43 | brixen | ok |
| 17:49:15 | evan | when we do that |
| 17:49:24 | evan | we can redo MethodTable to use a cuckoo hash algo |
| 17:49:36 | evan | which is exactly the rigth algo for this |
| 17:49:45 | brixen | cool |
| 17:49:46 | evan | since the read/write ratio is almost infinite |
| 17:49:58 | brixen | so for now, I should just fix undef_method? |
| 17:50:51 | evan | yeah |
| 17:50:58 | brixen | k |
| 17:50:58 | evan | put a note near your fix |
| 17:51:04 | evan | that we need to change the MethodTable protocol |
| 17:51:16 | brixen | will do |
| 17:51:52 | evan | i'm working on fixing up some of our IO |
| 17:51:57 | evan | should have it in shortly |
| 17:51:58 | brixen | ahh, it is instance_method that is broken |
| 17:52:03 | brixen | cool |
| 17:53:37 | evan | i somehow broke IO in the process |
| 17:53:40 | evan | so I have to backout the fix |
| 17:53:46 | evan | and reintroduce it to find the breakage |
| 17:53:48 | evan | it's really weird. |
| 17:53:54 | evan | it's like IO#close isn't working |
| 17:53:56 | evan | but it is. |
| 17:54:04 | brixen | weird |
| 17:54:13 | brixen | I'll add MethodTable to the roadmap |
| 17:54:25 | evan | k |
| 17:54:31 | evan | we should probably change MethodTable soon |
| 17:54:37 | brixen | yeah |
| 17:54:54 | slava | evan: with the tagging scheme I described earlier you can do a full dispatch (not ICs) in about 19 instructions |
| 17:55:12 | slava | and of course if you have ICs its even better in the common case |
| 17:55:44 | evan | slava: using cmov? |
| 17:55:56 | slava | yeah, that thing we talked about |
| 17:56:13 | slava | you can make your method dispatch much faster |
| 17:56:22 | slava | right now you're probably doing 10x more work |
| 17:56:38 | evan | probably a good call |
| 17:56:45 | evan | after this IO fix is |
| 17:56:49 | evan | i'll check out the assembly |
| 17:57:15 | evan | what was your code again? |
| 17:57:27 | evan | ie, what was the condition being used? |
| 17:57:29 | evan | the tag value? |
| 17:59:59 | slava | you check if the tag is 0 branchlessly |
| 18:00:10 | slava | if its any other tag you load the class pointer from the header |
| 18:52:22 | tilman | evan: http://f7b9300c6aadaae3.paste.se/ ? |
| 18:54:24 | evan | thats fine |
| 18:55:13 | tilman | cool |
| 19:00:17 | brixen | I was thinking, I should get the gprof graph output added to our profiler |
| 19:00:32 | brixen | because it will give you the methods that call heavily used methods |
| 19:00:49 | brixen | eg, something that calls String#[] a bunch may be able to use a better algo |
| 19:01:02 | brixen | even if String#[] can't be optimized further |
| 19:01:34 | brixen | it's not easy to determine this from the flat output |
| 19:01:36 | tilman | brixen: you mean, teach the profiler to generate call graphs? |
| 19:01:44 | brixen | it already has the info |
| 19:01:50 | evan | brixen: sure, that would be swell. |
| 19:01:53 | brixen | just need to do the output |
| 19:02:14 | brixen | tilman: see this page under How to read the call graph |
| 19:02:16 | brixen | http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html |
| 19:02:57 | tilman | brixen: i know what a call graph is, just wasn't sure if i understand your proposal correctly :) |
| 19:03:08 | brixen | tilman: swell |
| 19:03:26 | brixen | also, someone already did this for the sampling profile, so could probably adapt that code |
| 19:03:29 | tilman | is gprof the profiler of choice in osx, btw? |
| 19:03:45 | brixen | not that I know of |
| 19:03:47 | evan | no |
| 19:03:48 | evan | Shark is |
| 19:04:02 | brixen | MRI uses the gprof flat output, that's why we copied it |
| 19:04:03 | tilman | ah, i think i've heard about that one |
| 19:04:07 | evan | it's a sampler |
| 19:04:15 | evan | and thus a little less acrurate than gprof |
| 19:04:19 | evan | but sooooo much easier to read |
| 20:09:21 | boyscout | SymbolTable::lookup now works with char pointers instead of std::strings. - f78d000 - Tilman Sauerbeck |
| 20:09:21 | boyscout | Added String::hash_str() variant that works on NUL-terminated strings. - 040b5f2 - Tilman Sauerbeck |
| 20:14:24 | boyscout | CI: Build 040b5f2 failed. http://ci.rubini.us/rubinius/builds/040b5f26fd9c9d435a0071b10a3dc261610049b0 |
| 20:14:48 | brixen | heh tilman! :P |
| 20:14:56 | brixen | finally someone else breaks the build :) |
| 20:15:23 | evan | tilman: did you run the tests? |
| 20:15:32 | tilman | wah |
| 20:15:47 | tilman | ugh ugh ugh |
| 20:15:49 | tilman | sorry :( |
| 20:17:19 | evan | tilman: are you commiting a fix now? |
| 20:17:24 | tilman | yes |
| 20:17:27 | tilman | 5s |
| 20:20:10 | boyscout | Removed two VM tests for methods that were removed in the previous commit. - ee07298 - Tilman Sauerbeck |
| 20:24:52 | boyscout | CI: ee07298 success. 2647 files, 10140 examples, 32380 expectations, 0 failures, 0 errors |
| 20:27:52 | boyscout | Report the name of a DelegatedMethod is being used as - 8161d46 - Evan Phoenix |
| 20:27:52 | boyscout | Fix Kernel#caller to skip kernel/ frames - ec1a67a - Evan Phoenix |
| 20:27:52 | boyscout | A couple hacks to make throw/catch interact properly - 9a3f572 - Evan Phoenix |
| 20:27:52 | boyscout | Fix a number of IO/Signal interaction issues - e6bb96a - Evan Phoenix |
| 20:27:53 | boyscout | Fix Kernel#caller to honor exclude_kernel properly - 13432e3 - Evan Phoenix |
| 20:36:11 | boyscout | CI: 13432e3 success. 2647 files, 10140 examples, 32380 expectations, 0 failures, 0 errors |
| 21:50:58 | evan | therealadam: poke poke poke |
| 21:51:10 | therealadam | giggle |
| 21:51:17 | evan | see my twitter DM |
| 21:51:24 | evan | which imax section did you get? |
| 21:51:40 | therealadam | A3 |
| 21:51:41 | therealadam | I think |
| 21:51:46 | evan | check check check! |
| 21:51:49 | evan | i wanna buy my ticket |
| 21:51:53 | therealadam | I think their just adult, senior and child prices |
| 21:51:58 | evan | oh |
| 21:52:06 | evan | why don't they just say so.. |
| 21:52:17 | therealadam | I'm just speculating |
| 21:52:23 | therealadam | I went with adult, 'cuz that's what rich got |
| 21:52:37 | therealadam | but, on principle, I usually go senior |
| 21:53:41 | evan | ok |
| 21:53:42 | evan | got it! |
| 21:54:50 | therealadam | word. |
| 21:55:18 | evan | we shall watch cute kirk defeat the pythonista threat! |
| 21:55:33 | evan | seriously, Eric Bana looks snakish |
| 21:55:42 | therealadam | do you know if the LV books have for the over/under on Greg Borenstein and I getting an LLVM/AVR backend working next week? Because I'd like to vote for "no". |
| 21:56:16 | evan | oooh |
| 21:56:21 | evan | do ya need some help? |
| 21:56:27 | therealadam | might |
| 21:56:33 | therealadam | I've been boning up |
| 21:56:38 | therealadam | need to read a few more docs |
| 21:56:41 | evan | www.awkwardboners.com |
| 21:56:44 | therealadam | and then really look at the backend |
| 21:56:49 | therealadam | codes |
| 21:56:59 | therealadam | I am hoping for good things from that link |
| 21:57:21 | therealadam | also, I am hoping for no auto-play song "this guy's surfing for boners!" |
| 21:59:49 | evan | hah |
| 21:59:51 | evan | no, no song |
| 21:59:53 | evan | it's pretty funny though. |
| 22:00:08 | evan | therealadam: i've been through a lot of LLVM code |
| 22:00:15 | evan | so i'm more than happy to assist |
| 22:00:18 | evan | i want to play with AVR soon |
| 22:01:08 | therealadam | cool. I'd also like to find something I can help out with on Rubinius. You know; when I'm not hacking backends for 8-bit processors. |
| 22:01:21 | therealadam | perhaps we can scratch each other's back, as they say |
| 22:01:53 | evan | if we get a 3rd person, it's easier to do it all at the same time |
| 22:01:59 | evan | otherwise we'll end up making out |
| 22:02:51 | therealadam | oh, is the common turn-of-phrase "scratch each other's boner"? I always get these things wrong. |
| 22:03:30 | evan | maybe in vegas it is. |
| 22:03:33 | evan | wouldn't surprise me. |
| 22:03:41 | therealadam | oh, Vegas rules. my bad. |
| 22:04:29 | evan | oh btw |
| 22:04:33 | evan | you'll love this. |
| 22:04:33 | evan | http://www.youtube.com/watch?v=WPkMUU9tUqk&feature=dir |
| 22:06:58 | therealadam | come and get some of this shit. |
| 22:06:59 | therealadam | love it |
| 22:07:12 | therealadam | all that european stuff |
| 22:07:13 | therealadam | classic |
| 22:07:37 | therealadam | hey, does LLVM have a pass for optimal deliciousness? |
| 22:08:22 | therealadam | oh lord, thankyou |
| 22:22:54 | headius | http://www.youtube.com/watch?v=N0gb9v4LI4o |
| 22:28:51 | evan | those are awesome |
| 23:08:59 | drbrain | http://www.thedailyshow.com/video/index.jhtml?videoId=225921&title=large-hadron-collider |
| 23:37:31 | rue | Those bastards cut off most of .eu countries |
| 23:41:06 | drbrain | rue: :( |
| 23:42:47 | rue | Possibly not .de, though, so I am setting up Squid on my server now... |
| 23:45:33 | benny | yeah I can load it... I'm in .de |
| 23:45:40 | tilman | evan: i need to use mp_init_set_long (defined in bignum.cpp) in marshal.cpp. can i move it to libtommath/? |
| 23:45:59 | rue | I almost started looking for public proxies before I caught the stupid |
| 23:46:27 | benny | where are you from rue? |