Index

Show enters and exits. Hide enters and exits.

06:42:33boyscout1.8.7: Integer#odd?, #even?, #ord, #pred (new methods implementation) - 31e84c6 - Marc-Andre Lafortune
06:42:33boyscout1.8.7: Kernel#tap (new method implementation) - f5d4ad5 - Marc-Andre Lafortune
06:42:33boyscout1.9: Kernel#define_singleton_method (implementation of new method) - 4d5a9e8 - Marc-Andre Lafortune
06:42:33boyscout1.9: #methods, #constants, etc.., returns symbols in 1.9 - 390dc77 - Marc-Andre Lafortune
06:42:33boyscout1.8.7: ObjectSpace#each_object (returns enumerator when no block) - d3a9948 - Marc-Andre Lafortune
06:42:34boyscout1.8.7: Proc#call now aliased as Proc#yield - 7c0bc7f - Marc-Andre Lafortune
06:42:36boyscout1.8.7: Range#each, #step: enumerator returned when no block - 8af731d - Marc-Andre Lafortune
06:42:38boyscoutRegexp.union (rewrote to pass specs. 1.8.7+ compatible too) - fba5c51 - Marc-Andre Lafortune
06:42:40boyscoutMoving some io stuff around - bcb33f3 - Marc-Andre Lafortune
06:42:42boyscout1.9: String.try_convert (implementation of new method) - 09e59d0 - Marc-Andre Lafortune
06:42:44boyscout1.8.7: String#each_char (implementation of new method) - 97d99b9 - Marc-Andre Lafortune
06:43:09evangeez.
06:43:19marcandrelol
06:43:32marcandreAm I cutting my commits in too small chunks?
06:43:42evanno, thats ok.
06:44:07marcandreCool. Mostly done with 1.8.7 stuff.
06:44:17evanrad.
06:44:34evanthough
06:44:41evanglobal private methods are generally a nono
06:44:52evanlike convert_to_constant_names
06:44:56evanplus, thats not what it does
06:45:10evanthat method seems needless.
06:45:20marcandreGuilty as charged.
06:45:42evanoh, i see what you did.
06:45:51evanso you could override it
06:46:02evanyeah, move that to something with a much more sensible name
06:46:04evanperhaps
06:46:32slavahi evan
06:46:41marcandreOk, I'll think of something more sensible.
06:46:42evanRubinius.convert_to_names
06:46:51marcandreSounds good.
06:47:00evanslava: allo sir.
06:47:33evanalso
06:47:36evanwhy did you change fileutils.rb?
06:47:50evanthat METHODS constant can be an array of strings, thats fine.
06:48:19marcandreI changed it to an array of symbols (I prefer symbols). It had to be one or the other, for 1.9 compatibility.
06:48:44marcandreIt used to do methods - %w(....), which doesn't work if methods returns symbols.
06:49:02evanright
06:49:03evanbut why change it?
06:49:09evandoesn't seem necessary
06:49:31boyscoutCI: 97d99b9 success. 2682 files, 10322 examples, 32867 expectations, 0 failures, 0 errors
06:49:46marcandreWell, it's either I did a map{|m| m.to_s} or map{|m| m.to_sym}
06:49:48evanwe try hard to not go changing things like fileutils
06:50:05marcandreOh, you mean someone might rely on that constant?
06:50:07evanah, because singleton_methods changed.
06:50:09evani see.
06:50:11evanok
06:50:14evanin the future, when you do that
06:50:19evanthrow a comment above it
06:50:22evanto indicate why
06:50:39marcandreOk. What's so special about fileutils?
06:51:27evannothing particular
06:51:35evanmainly that we try hard to not modify the stdlib
06:51:46evanbecause it's craziness is found in the real world
06:51:51evanso we have to deal with it being weird
06:52:02evanit's a good test bed.
06:52:06marcandreAh, sorry, I didn't realize it was straight from the ruby lib.
06:52:16evan99% of it is.
06:52:21evanwe didn't reimplement any of it.
06:52:27evanfigured that would be silly
06:52:31evanthere are a couple exceptions
06:52:35marcandreBTW, the 1.9 version is Symbols.
06:52:35evanweakref and a minor irb extension
06:52:51evanversion of what?
06:52:59marcandreI'll throw in a comment then, and double check when I modify the stdlib.
06:53:05marcandrefileutils.rb in the 1.9 distribution
06:54:07marcandreYou might want to double check what I'm doing for Kernel#__method__ is OK. It's in lib/1.8.7/kernel.rb
06:56:34evanok, checking now.
06:57:36evanit just returns the name of the currently running method, yes?
06:58:02marcandreyup
06:58:19evanyou can probably get rid of the scope check then
06:58:26evanjust walk the backtrace until you find the first non-block
06:58:31evanoh wait..
06:58:39evanthe block call path will obscuret hat
06:58:41evani see...
06:58:44marcandreyup
06:59:13evanyeah, i think this is ok
06:59:19evanthere might be a nicer way
06:59:23evanbut it's not coming to me off hand
06:59:30evani'm happy that you came up with this on your own actually :D
06:59:38marcandreCool!
06:59:41marcandre:-)
07:00:09evanthe delegated method thing might break
07:00:32evani'd have to think about it
07:00:36evani guess thats for define_method?
07:00:49marcandreExactly
07:01:20marcandreTook me a while to understand what was going on, and it's a bit ugly but I didn't see any other way
07:01:36evanyeah
07:01:44evanthats probably an area I should clean up a little
07:02:14evanalso
07:02:25evanshould __method__ report the name the method calls itself, or the name it was called as
07:02:28marcandreI don't know. I took the tests from MRI and they have special checks for define_method, so I guess it has to be a bit more difficult
07:02:30evanie, if a method is aliased
07:02:35evanwhich name is shown?
07:02:46marcandrethe defined name.
07:02:51evanok
07:03:10marcandreGood thing, coz I didn't see a way to get the name it was called as!
07:03:22evanit's in Location
07:03:24evan.name
07:03:33evanthats how our backtraces show both names
07:04:04marcandreAh, yes.
07:04:31marcandreActually now I think I used to use that until I realized the specs had changed from one version of MRI to the next.
07:04:42evan:/
07:04:48marcandre(no comment! ;-)
07:05:08evanperhaps what I should do is make Location generation smarter
07:05:15marcandreAnyways, it passes the same specs as Ruby 1.9
07:05:15evanit can see the lowlevel structure
07:05:27evanit should be aware of calls via DelegatedMethod
07:05:38evanso it can simply pull in the proper info
07:05:49marcandreYou probably have some more important things to do right now!
07:05:55evan:D
07:06:02evanbtw
07:06:14evanthank you for not duplicated the entire ObjectSpace#each_object
07:06:17evanto add enumerator support
07:06:21marcandrelol
07:06:27marcandreYeah.
07:06:28evanthats clearly one place where the stategy of keeping them seperate was a bad idea
07:06:38evandoing a simple alias trick is fine.
07:06:49marcandreI thought that the alias thing would be fine there.
07:07:33marcandreI've never used ObjectSpace and I doubt it's used by many. Those will have to "suffer" a backtrace showing the alias jump.
07:07:55evanpeople use it for debugging
07:08:08evanand for a couple of places that MRI doesn't provide some info
07:08:11evanlike the list of subclasses
07:09:28brixenand rails uses it as a class registry :/
07:10:00brixenevan: some data for you to ponder http://gist.github.com/113844
07:10:28brixenin particular, see the # of array instances running rails -h (bottom file)
07:10:31evanthis is for array or hash?
07:10:47evanah ok
07:11:23brixenI'm wondering if the # of arrays is the sexp during eval
07:11:40brixenbut I don't know off hand how much rails does eval for -h
07:12:10evangeez.
07:12:14brixenI didn't run string_spy for rails -h yet because the array one took a very long time (~30 min)
07:12:16evanit uses it a bunch I think
07:12:28evanto create a whole bunch of methods
07:12:37evani'm not sure exactly to what extent
07:12:42brixenk
07:13:01brixenwell, it is interesting to see that most objects do not get methods called on them much
07:14:13brixenI'm finishing up the hash benchmarks now and I'll push the class_spy and bm's
07:14:19evansweet.
07:14:41brixenit is interesting to profile from the perspective of each object
07:14:53brixenthe class spy would let you do quite a bit of analysis
07:15:08brixenyou could see if # of method calls was correlated with size, for instance
07:15:27evansweet.
07:15:36evani'm interested to see how it spys :D
07:15:51brixenit's not sophisticated
07:15:54brixenjust aliasing methods
07:16:01brixenbtw, got some strange results
07:16:17scooprfedora, cigar and nightvision goggles.
07:16:27brixenshouldn't you be able to #send to any method and that be equivalent to an actual call?
07:16:42evani'd think so
07:16:48evanunless that class has it's own #send
07:16:55evanwhich we've got a couple that do
07:16:58evanuse __send__
07:16:59brixenI could not alias String#=~
07:17:00evanbut otherwise, yes.
07:17:03evanin MRI?
07:17:07brixenit would break things
07:17:10brixenin rbx
07:17:12evanhm.
07:17:15evanin MRI, it's not called.
07:17:16brixenI haven't run this in MRI
07:17:19evanok
07:17:32evanbreak how?
07:17:34brixenhere, I'll push it and push the bm's later
07:17:37evank
07:17:38marcandreIn MRI, you can't alias_method gsub
07:17:43brixenI need to update my branch though
07:18:00brixenmarcandre: interesting, #gsub was another that was breaking things
07:18:05evan10-4
07:18:06brixenlike the irb prompt formatting
07:18:08evanoh
07:18:10evani know why.
07:18:12marcandreYeah. Well, you can, but it's a b*tch
07:18:15evanit's $~
07:18:18marcandreIt's because of $1 and stuff
07:18:20evansame for MRI
07:18:22marcandreExactly.
07:18:27evanyou can fix it in rubinius though
07:18:27brixenok makes sense
07:18:32marcandreSo you need to set it manually. Pretty ugly.
07:18:52marcandreSo you can actually alias_chain it, but you have to do extra stuff.
07:18:57evan Rubinius::VariableScope.of_sender.last_match = last_match
07:19:03evanif you do that in the alias
07:19:05evanwell, it would be
07:19:11evanRubinius::VariableScope.of_sender.last_match = $~
07:19:18evanto push it one level up
07:20:25marcandreSimilarly in MRI, you get the binding of the block and use that to set $~.
07:20:39evani don't think MRI exposes it though.
07:20:46evanso you have to do it in C land.
07:20:51marcandreFor gsub, you have the block.
07:21:00marcandreFor =~, you're probably toast in MRI
07:21:03evannot sure that helps
07:21:10evanthis is why $~ sucks.
07:21:46marcandreYeah, I was able to do it. I needed to alias_method_chain gsub for 1.8.7 in backports, but in the end I said 'f*ck this', I'm not implementing this change.
07:21:55evanbrixen: check out String#gsub!
07:22:02evanthats an example of conditionally pushing $~ up one level
07:22:07evanthrow that in your alias code
07:22:54brixenk
07:23:06brixenwell, we can add that
07:23:16brixenclass_spy boilerplates the alias chains
07:23:26brixenbut you can do individual ones
07:23:44evanyou could just have it add the code if the method name is in a list
07:23:51evan:=~, :gsub, etc.
07:23:56brixensure
07:24:07evan:=~ looks like an anteater
07:24:21brixenor a tadpole
07:24:27evanheh
07:24:29brixenwith big eyes
07:24:48evanoh humans and their symbology....
07:24:53evanthe source of so many problems
07:24:55evanand so much fun.
07:25:56brixenone of the other things the aliasing was messing up was Array#sort
07:26:06brixenI ended up implementing a sort on the Stat class
07:26:22evanah yeah
07:26:30evanyou could just include Enumerable too
07:26:33evanit's got sort.
07:26:42brixeninvestigating that I came to think that we might do better with a variation of Heap sort instead of qsort in core lib
07:27:01brixenwell, this sort is 2 methods
07:27:14brixenperforms very well compared to core qsort
07:27:18evannice
07:27:35brixenand doesn't have pathological behavior with sorted data sets
07:27:52brixenmost of these 10's of thousand element arrays are already mostly sorted
07:27:58brixenlong runs of the same values
07:28:12evansure
07:29:15boyscoutAdded ClassSpy for gathering usage statistics. - dcc65fc - Brian Ford
07:29:23brixenok, have a gander at that
07:29:39brixenidea was to make it really easy to add a class spy
07:29:49brixenas you can see from the Array and String examples
07:30:06brixenbut still be able to do the stuff Hash spy does
07:30:13brixenie, the key stats
07:30:58boyscoutClean up - 69c3422 - Marc-Andre Lafortune
07:31:00brixenmain problem is it can be very slow feeding all the data to the Stat instances
07:31:23evanhah
07:31:28evan+ :'^' => 'hat'
07:31:30evanlove it.
07:31:34brixenheh
07:31:54brixenanyway, feel free to mess with it
07:31:59brixenjust don't break it :P
07:32:35evanbreaks
07:32:42brixen:)
07:32:44evanyou guys break my stuff all the time!
07:32:49evanit's only right that I return the favor
07:32:53brixenyeah
07:33:08boyscoutCI: dcc65fc success. 2682 files, 10322 examples, 32867 expectations, 0 failures, 0 errors
07:33:16brixenif only the world were a fair place :)
07:33:35evantrue enough.
07:38:30brixenevan: so something that really surprised me in this http://gist.github.com/113844
07:38:45brixenlook at how few calls to Array#== and #<=> in the bottom one
07:38:55brixenrails -h
07:39:28brixenbasically, the distribution of calls across the array methods
07:52:27brixenanother very interesting thing is the ratio of calls to Hash#[] and []=
07:52:32brixenfor rails -h
07:52:43brixenat 80%, they are equal
07:53:20brixen> 80%, the ratio inverts and #[]= is quite a bit more than #[]
13:53:15ruebrixen: You can add heuristics for the sorting, too
17:19:16rueHah, "caret" not common enough name?
17:20:47brixenhat is shorter and hence the program will run faster
17:21:29rueOh, true
17:21:43rueIs your syntax highlight set for red strings?
17:21:58brixenred strings?
17:22:21rueRed will make it at least double faster
17:39:43rueevan: Do you have a gauge on the jit time for a method?
17:42:19evannot off hand, no.
17:42:26evanI should go add some timing code in though.
17:42:41ruePurely empirically it seems not obscene
17:42:58rue(High praise, eh?)
17:43:21evanthank you mi lord
17:44:18rueAnytime
17:46:35brixenI really like this benchmark harness
17:47:07evanwhich?
17:47:46brixenthe one I wrote that ouputs to yaml
17:47:59brixenI'm running the hash benches with cuckoo now
17:48:08brixenshould have some results shortly
17:53:45ddubit should be obscene
17:53:47ddubobscenely fast
17:53:49ddub;-)
18:57:09rueMaby
18:58:36devinushow do i install gems for rubinius?
19:02:07rue`vm/vm gem install ...`
19:02:20rueOr `bin/rbx` if you feel like typing extra ;)
19:03:57devinusrue: how do i enable the external gem sources?
19:04:53rueThe gem command should take all the normal parameters, although I thought -r was already default
19:05:11rueYou can do `vm/vm gem {env,help,sources}` etc.
19:05:13brixenuse a .gemrc or the --source URL option
19:05:37brixenbin/rbx gem env to see what is set
19:08:35dbussinkrunning the ci set with jit enabled fails for more people?
19:09:07brixenhaven't tried it
19:09:22brixeneverybody wants the shiny
19:09:30brixen:)
19:11:02rueI had a segfault in Float last time
19:11:33dbussinkbrixen: shhhiiiiinyyyy
19:11:35dbussinkmuhahaha
19:12:29devinuscan you install merb through rbx?
19:13:31rueThink so, give it a try
19:13:48rueWas I dreaming when I thought someone already fixed the __STDC_LIMIT_MACROS problem?
19:13:51dbussinkrue: segfaults in bignum for me
19:14:39rue...Wtf, now it did include it?
19:14:45brixendevinus: yeah you can
19:15:04brixendevinus: most gems install, but if they have C ext they might not build
19:15:12brixendevinus: if you encounter that, just let us know
19:15:22devinusbrixen: on leopard do_sqlite3 fails to build
19:15:30devinusbrixen: latest git pull
19:15:33rueYou should blame dbussink for that ;)
19:15:34brixenyeah, the 0.9.11 right?
19:15:47brixendevinus: or the do next branch?
19:15:52dbussinkdevinus: hmm, why does it fail?
19:16:00devinusdbussink: one sec
19:16:04rueI never understood this "next" branch idea
19:16:46brixenrue: just comes down to whether you want your head living in the past or the future
19:17:11brixenI prefer to live in the future
19:17:18brixennot much of a retro guy I guess
19:17:24devinusbrixen, dbussink: http://pastie.org/483057 -- that's all i know
19:17:32rueWhy would you want stuck on some previous point? That is what tags are for :P
19:17:45brixenoh nasty
19:17:46brixenbus error
19:18:04brixenrue: as with all things opinion...
19:18:05dbussinkis not going to take the blame (hopefully)
19:18:26brixendevinus: again, was that DO head or next branch?
19:18:32ruebrixen: Well, sure, but this one is going actively against the tool
19:18:32brixenor is next now head
19:18:36dbussinkbrixen: just released DO a few days ago
19:18:40rueThough I am not sure why I am arguing with you
19:18:43dbussinkso should be all good
19:18:48brixendbussink: sweet
19:18:48ruedbussink: Why are you using "next" ;)
19:18:52devinusbrixen: uhh the latest on rubygems i suppose
19:19:01dbussinkrue: actually, this is the same arrangement as the git guys themselves use
19:19:21brixendevinus: ah, you said latest git pull, so I was confused
19:19:24dbussinkrue: so i think dkubb took it after that, i don't really care that much
19:21:36brixengoogle docs not showing the formula in a bar when you click on a formula-havin cell is mega annoying
19:22:22brixenlike, why would I need to see my formula without double-clicking in a cell
19:22:54brixenahh there it is
19:23:03brixenno sensible in that default
19:23:14rueI think that is a _repository_
19:23:57brixenrue: public IRC isn't a forum for your bathroom issues
19:25:25dbussinkthe failure is consistent
19:32:32rueYeah, probably not. Christ.
19:32:43ruedbussink: Bignum still?
19:32:50dbussinkrue: yeah
19:37:57devinusholy crap
19:38:00devinusis it just me
19:38:07devinusor does rubinius take forever to install gems?
19:38:18rueShould figure out what exactly is breaking in -O2 on 4.2.1
19:38:42ruedevinus: The first one definitely takes a bit of time because stuff is getting compiled
19:38:59rueAfter that it has been reasonably fast for me
19:39:07devinusrue: yeah, but ri and rdoc generation is slooooow
19:40:04devinushow do i have an .irbrc for rbx?
19:40:32rueOh, yeah, I have --no-ri and --no-rdoc in .gemrc
19:44:14brixenwe should make --no-ri and --no-rdoc default
19:44:23devinusbrixen: why? why does it take so long?
19:46:09brixendevinus: because rdoc is pure ruby and it takes rbx about 4x as long to run it right now
19:46:15brixenwe're working on that
19:46:32devinusbrixen: ah
19:46:41brixenso, unless you need rdoc generated by rbx (it's the same as mri, promise), you should turn it off
19:47:06dbussinkbrixen: btw, is rubygems still customized? because a gem update --systems gives an error for me
19:49:40brixendbussink: it is
19:49:44brixenand we should remove it
19:50:02brixenand just do the normal rubygems install and check it in
19:50:28brixenbut we may need to do some rbconfig updates
19:50:29dbussinkbrixen: this is what it gives me now: http://gist.github.com/114315
19:50:41brixenI asked what rubygems depends on but got less than helpful responses
19:50:58brixendbussink: yeah, not surprised
19:51:04brixenare you having an issue with rubygems?
19:51:09brixenthe one we ship?
19:51:41dbussinkbrixen: there's some new stuff in 1.3.2+ i want to use, so i can package stuff without using hoe
19:52:05brixenah good reason
19:52:08dbussinkcouldn't find how to release prebuilt binaries with hoe, so took some stuff from luis
19:52:18brixenwell, I can take a look at it or you can
19:52:33dbussinkbrixen: any idea where i should look for that bug?
19:52:33brixenI'm working on Hash atm
19:52:41brixennot without looking at it
19:52:56brixenI know very little about the joy that is rubygems
19:52:59dbussinkbrixen: ah ok, no rush :)
19:54:23brixendbussink: are you shipping rbx gems for DO?
19:54:42dbussinkbrixen: nope, rbx should be able to use the regular mri gems
19:54:47brixenok
19:54:53dbussinkthe prebuilt ones are for windows and jruby
19:55:40brixenbut you want to use rbx to make the prebuilt jruby gems? that would be... fantastic :)
19:56:15dbussinkbrixen: hehe, if rbx could build everything at once :P
19:57:12dbussinkbrixen: i wanted to see why rbx failes on the extconf, and to test it from the git clone easiest way was to upgrade rubygems
19:57:18dbussinkso that's how i got to the failure
19:57:23brixenah I see
20:02:11devinusrbx(1991,0xa06c0720) malloc: *** error for object 0x218ca60: double free
20:02:11devinus*** set a breakpoint in malloc_error_break to debug
20:02:17devinusfinding a lot of those
20:10:19dbussinkbrixen: any tests that i should run to check whether the updated rubygems works?
20:10:45dbussinkit installs stuff into lib/rbx/gems/1.8 now btw
20:11:18brixenthe rubygems tests+
20:11:19brixen?
20:11:39devinusdbussink: installing thin bus errors too
20:11:58dbussinkdevinus: yeah, there's something up in rubinius, not in the gems
20:12:10ruedbussink: Installed rbx?
20:13:26dbussinkrue: no, running it from within the clone
20:13:39rueOh, with a new Gems?
20:14:04dbussinkrue: yeah, updated rubygems
20:14:11rueOtherwise everything should go into ./gems
20:14:37dbussinkbrixen: did all the rubygems tests pass?
20:15:41brixendbussink: dunno
21:15:14dgtizedbrixen: what is the default sort order on -P profiler? I can't work it out
21:16:24dgtizedfor instance: http://gist.github.com/114357
21:19:08dgtizedthat and using -Ptime -Pcalls and the like don't seem to have any effect
21:20:05rueMm, yeah, similar result here...but I do not recall that having been the result
21:20:32dgtizedoh it's not time, it's percent, but still
21:25:33rueThink the sort is never initialised
21:27:18dgtizedit's in set_options I thought
21:27:45dgtizedthough not sure why it's not in init
21:31:27devinusis there going to be a 100% compatible 1.8 C-API and then a newer -you-should-be-using-this API?
21:32:31dgtizedrue: oh check out sort_order, I think the Array call just isn't using all the keys
21:38:17rueMm, think the sorting itself...got it working with sort_by
21:39:01dgtizedyea, I caught that, except sort_by makes it tricky to do the ordering if you wanted to use multiple columns
21:39:13dbussinkbrixen: hmm, rubygems doesn't even pass the tests on mri
21:39:31ruedgtized: Nah
21:41:06dgtizedbut I guess there is no way to set multiple columns anyway
21:41:09dgtizedso maybe that's silly
21:41:45dgtizedbut yea the break cmp in the data.sort! block in flat is what is to blame
21:41:50rueYou can give the switch multiple times
21:42:03dgtizedno append
21:42:22dgtizedand the default's not even an array
21:42:43dgtizedand how would you determine if the first one is an append to the sort order, or a whole new sort order?
21:43:47rueAssume append?
21:44:35dgtizedthen you can't set the primary column
21:44:51dgtizedif you want to sort by cumulative and not by percent
21:45:04dgtized-Pcumulative would set the order to [:percent, :cumulative]
21:45:22dgtizedwhen what you want is [:cumulative,:percent]
21:45:28dgtizedI guess you could just push to the front
21:46:23dgtizedanyway, I don't really think we need to be able to sort on two columns
21:46:37brixendgtized: why do you think that?
21:46:50dgtizedbrixen: well it's not working at all now
21:46:50brixenbtw, evan changed the return to a break in that sort code
21:46:57brixendid you test that?
21:47:00dgtizedyes
21:47:06dgtizedlook at my gist a ways back
21:47:09rueI think this sort_by may be cleaner anyway
21:47:12dgtizedit's not worting at all
21:47:16brixenit was working fine before
21:47:17dgtizedsorry sorting
21:47:20dgtizedwell it's not now
21:47:29brixenso?
21:47:58brixenif it's not the code that changed, then why are you looking at code that didn't change to understand why sort is not working?
21:48:28dgtizedthe only way to get sorted order as it currently stands, ignoring the fact that the sort simply DOES NOT WORK, is if you wanted to sort on multiple columns you would have to do a manual set_options call, it won't work through the commandline options
21:48:51brixenwhy is it not working now?
21:49:16dgtizedbecause break cmp is returning to the inner block, and then it's always returning 0 from the sort block
21:49:27brixendon't change code unless you understand the root cause
21:51:20dgtizedI understand the root cause, break doesn't break out of two blocks, it only breaks out of one block
21:51:24dgtizedthe code is wrong
21:51:38brixenso why is break being used there?
21:51:57ruedgtized: Actually, you are right, it does not allow two currently I think
21:52:25dgtizedthe break is not the problem, it's that the return value from break doesn't get passed into cmp, and cmp is not returned it just always returns 0 so it never sorts on anything
21:54:41rueThe multicolumn sorting add is a bit nasty, probably best support it with -Pcol1,col2 or something
21:55:14boyscoutSimplify profiler output sorting logic. Need to add multicolumns still. - b3e1bb0 - Eero Saynatkari
21:55:53ruedgtized: That should have -P and single-specified-column working
21:56:59dgtizedyea I see that
21:57:45dgtizedheh, the sort order thing is actually a place to use throw, catch
21:57:51rueIf you want to add the multicolumn, just need to figure out how exactly to get the column names (-Pn,m,z ?) and just add it
21:57:52dgtizedif you use the sort!
21:58:15boyscoutCI: b3e1bb0 success. 2682 files, 10322 examples, 32867 expectations, 0 failures, 0 errors
21:58:39dgtizedit's in loader.rb, I'll look at it
22:01:28dgtizedsort_by is really hard to sort on multiple columns though
22:07:34rueHm?
22:09:01rueSomething like `e#-row[sort_order.first] }
22:09:35rueErm, `data = data.sort_by {|row| columns.map {|col| row[col]} }.reverse`
22:10:54brixenthat's some nice code
22:12:16brixenthis has a very simple solution
22:12:27brixenwhich I shall push straight away
22:12:55dgtizedalright, cause I have one two but ok
22:13:00dgtizedtwo == too I mean
22:13:33brixenoh?
22:13:38brixenwhat's yours?
22:14:15dgtizedhttp://gist.github.com/114409
22:15:21brixenwhy did you move it to initialize?
22:15:54dgtizedbecause it's clear there, it's a default, otherwise it's only a default when you set options
22:16:01brixenand why would you guys think sorting and then reversing is a good idea?
22:16:25brixenit's a default period
22:16:40dgtizedno, because set_options has to get called
22:16:45brixenyou put that code right above the call to set_options in initialize
22:16:52brixenit does get called
22:16:56brixenfrom #initialize
22:17:12dgtizedright, but why put it over there when what's what it's always going to do?
22:17:23brixenwhat?
22:17:44dgtizedif you look at the code, you don't initially see where @options is initialized, or where the default value for sort is when you look at initialize
22:17:57dgtizedyou have to check set_options for that
22:18:05ruedgtized: You could default to :percent in #sort_options
22:18:05brixenso?
22:18:16brixenthat's why it's there
22:18:24rueOr explicitly set it when just -P is given
22:18:52dgtizedwhy is it clearer to initialize @options in set_options and not just in initialize
22:19:39dgtizedsecondly why would you do an ||= every time you call set_options?
22:19:52dgtizedif you are just doing a merge on top of it anyway?
22:21:41dgtizedrue: the problem with setting it in -P is if someone is initializing the Profiler by doing a require 'profile'
22:22:02dgtizedit does need to be in set options, but since it's a default why not just put it in where you initialize the @options var anyway?
22:22:06ruedgtized: Mm, true. Then I would go with defaulting it when requested
22:22:41dgtizedwhen you initialize Profiler you are requesting a default sort order that's how the old code works, that's how the new code works
22:22:55rueWell, you would have to (possibly) remove it if someone does _not_ want to sort by percentage
22:23:09dgtizedbut then you have to set it to another value
22:23:28dgtizedit's a default that you are merging over
22:23:53rue'S a toggle, though, you would need to implement an on/off. So it seems simplest to check if any preferences have been given and use percentage if not
22:24:59dgtizedhow is it a toggle, as soon as the old code hit set_options, which is also called from initialize it put in a value for :sort using an ||=
22:25:38brixendgtized: that's fine
22:25:41dgtizedthe only difference between the way I did it, and the old way, is that you won't get confused looking at the code and wondering if :sort has a value like you did earlier today
22:25:54brixendgtized: I suggest you use this code instead of sorting and reversing http://gist.github.com/114416
22:27:03dgtizedbrixen: yea that makes sense, I didn't like the reverse either
22:27:32rueI would go with whatever is easiest to read
22:27:36brixenand you should leave the Array() in there
22:27:49rueThis is not exactly the place to worry about performance
22:28:16brixen#reverse seems so much clearer to me, you're right
22:28:37brixendgtized: the client should be able to do :sort => :field
22:29:12dgtizedyea that makes sense
22:32:42rueWell, whichever way you prefer. It seems the previous version was a bit trickier to decode.
22:35:48boyscoutFixed flat profiler sorting and added multi-columns from commandline (pair brixen, rue) - 4092d98 - Charles Comstock
22:36:35dgtizedthat acceptable to all parties?
22:41:12rueI like curly braces, but sure
22:41:23boyscoutCI: 4092d98 success. 2682 files, 10322 examples, 32867 expectations, 0 failures, 0 errors
22:41:27brixenum, the sort_by and reverse is inscrutable to me
22:41:43dgtizedah, your sarcasm earlier was misread
22:41:53brixenthe code I had is exactly what a person would do with a selection sort
22:42:07brixenis this column less? ok go here, else go to the next
22:42:46dgtizedwell i'm sorry, I read your sarcasm as accepting it
22:43:02brixenwhy is sorting and reversing sensible?
22:43:50dgtizedhonestly if we had reverse_each I would say sorting and then walking backwards through the list would be the most clear
22:44:37brixenri Array#reverse_each ?
22:44:42brixenwhatever
22:44:44dgtizedit's in 1.8.7
22:45:53dgtizedanyway, if you want to change it to your way that's fine, I think the sort_by reverse is equivalently clear to the column one, I don't have a problem with it either way -- and again I'm sorry I misread your sarcasm as acceptance or I would have done it the other way
22:46:05brixenhttp://gist.github.com/114438
22:46:51dgtizedack I'm sorry, I looked for it in array and forgot that it was one of the ones that has moved into array_186 and 187
22:47:05dgtizedso I presumed it was new to 1.8.7 because it wasn't in 186
22:50:08dgtizedanyway, it actually works for all the cases right now versus before, so if you feel that level of clarity is necessary you are welcome to change it
23:11:30dgtizedare the send site / selector profilers no longer wired up in the kernel or just on the display end?
23:50:29tarcieriheh
23:50:36tarcieriwtf @ Ruby's parser
23:50:45tarcieri[:foo => 1, :bar => 2, :baz => 3]
23:51:22loopwhat did you expect?
23:52:08tarcieriparse error?
23:52:11tarcierior
23:52:18tarcieri[1, 2, :foo => 1, :bar => 2, :baz => 3]
23:52:21tarcieri^^^ for that to work
23:52:45slavasup tarcieri
23:52:55tarcierislava: boggling at oddities in the Ruby parser, heh
23:56:51ruetarcieri: The new keyword arg syntax?
23:57:06tarcierirue: this is in 1.8
23:57:26tarcieri[:foo => 1, :bar => 2, :baz => 3] is apparently equivalent to [{:foo => 1, :bar => 2, :baz => 3}]
23:57:37rueAh, yeah
23:57:53tarcierihowever [1, 2, :foo => 1, :bar => 2, :baz => 3] is a parse error instead of being [1, 2, {:foo => 1, :bar => 2, :baz => 3}]
23:58:16slavasyntax sucks
23:58:43rueWee