[Ironruby-core] Weird performance problem with "find"

Michael Letterle michael.letterle at gmail.com
Wed Feb 6 18:06:37 EST 2008


Bug has been submitted.  I'll probably poke it with a stick some while
I'm at it.

On Feb 6, 2008 5:58 PM, John Lam (DLR) <jflam at microsoft.com> wrote:
> Michael Letterle:
>
>
> > I have some ideas on what some of the issues may be, primarily related
> > to how the Enumerable class creates a new Proc object every time
> > through the loop.  Anyway, doing the following seems to help to some
> > extent:
> >
> > require 'mscorlib'
> > require 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll'
> >
> > a = (1..1000).to_a
> > s = System::Diagnostics::Stopwatch.new()
> > m = Proc.new {|x| x == 1000 }
> > 1000.times {
> >     s.start
> >   y = a.find &m
> >     s.stop
> >     puts "find took: #{s.elapsed.ToString}"
> >     s.reset
> > }
> >
> > find took: 00:00:00.0012998
> > find took: 00:00:00.0012719
> > find took: 00:00:00.0012915
> >
> > [snip]
> >
> > find took: 00:00:00.0049048
> > find took: 00:00:00.0052548
> > find took: 00:00:00.0051403
> >
> > [snip]
> >
> > find took: 00:00:00.0127650
> > find took: 00:00:00.0141006
> > find took: 00:00:00.0106432
>
> This is a strange; nothing obvious jumps out right now. We'll have to look at this down the road when we do our perf push. Clearly this is a bug. Can someone open up a bug for this?
>
> Thanks,
> -John
>
>
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>



-- 
Michael Letterle
[Polymath Programmer]
http://michaeldotnet.blogspot.com


More information about the Ironruby-core mailing list