Remco van t Veer
2007-Dec-11 09:29 UTC
Patch 10463: has_many through using uniq does not honor order
Hi, I''ve just submitted a patch for ActiveRecord; http://dev.rubyonrails.org/ticket/10463 The patch includes new fixtures because I could not find a applicable combination among the existing fixtures. I hope that''s okee. Please +1 or comment it. Thanks, Remco --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Pratik
2007-Dec-11 12:53 UTC
Re: Patch 10463: has_many through using uniq does not honor order
I suppose to_set.to_a was an optimization. I had a similar patch is the past - http://dev.rubyonrails.org/ticket/8802 But you have more tests and a valid point, so +1. It''d be great if you could somehow find a way to use existing fixtures. No big deal though. On Dec 11, 2007 9:29 AM, Remco van t Veer <rwvtveer@gmail.com> wrote:> > Hi, > > I''ve just submitted a patch for ActiveRecord; > > http://dev.rubyonrails.org/ticket/10463 > > The patch includes new fixtures because I could not find a applicable > combination among the existing fixtures. I hope that''s okee. > > Please +1 or comment it. > > Thanks, > Remco > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Remco van t Veer
2007-Dec-11 16:10 UTC
Re: Patch 10463: has_many through using uniq does not honor order
Thanks for you vote! I also guessed to_set.to_a is an optimization
but a naive benchmark shows it actually slower:
require ''set''
require ''benchmark''
data = (1..1000_000).map{rand 1000}
Benchmark.bm do |bm|
bm.report ''to_set.to_a'' do
data.to_set.to_a
end
bm.report ''uniq'' do
data.uniq
end
end
On Dec 11, 1:53 pm, Pratik <pratikn...@gmail.com>
wrote:> I suppose to_set.to_a was an optimization. I had a similar patch is
> the past -http://dev.rubyonrails.org/ticket/8802But you have more
> tests and a valid point, so +1.
>
> It''d be great if you could somehow find a way to use existing
> fixtures. No big deal though.
>
> On Dec 11, 2007 9:29 AM, Remco van t Veer <rwvtv...@gmail.com> wrote:
>
>
>
>
>
> > Hi,
>
> > I''ve just submitted a patch for ActiveRecord;
>
> > http://dev.rubyonrails.org/ticket/10463
>
> > The patch includes new fixtures because I could not find a applicable
> > combination among the existing fixtures. I hope that''s okee.
>
> > Please +1 or comment it.
>
> > Thanks,
> > Remco
>
> --
> Cheers!
> - Pratikhttp://m.onkey.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---