Re: Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-25 Thread hanwenn
On 2020/01/24 15:50:22, Dan Eble wrote: > On 2020/01/24 15:17:02, dak wrote: > > On 2020/01/24 14:11:59, Dan Eble wrote: > > > On 2020/01/24 14:06:22, hanwenn wrote: > > > > If the allocation cost becomes problematic, we can use another hashmap > > > instead. > > > > > > "We" could profile it and

Re: Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-24 Thread Dan Eble
On Jan 24, 2020, at 11:11, d...@gnu.org wrote: >> Don't assume the hash function is perfect: create the table with more > buckets, >> say 2*size. > > I'd not do that. It's second-guessing the implementation. The size > should be good as a hint. In particular if there are actual > duplicates...

Re: Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-24 Thread dak
On 2020/01/24 15:50:22, Dan Eble wrote: > On 2020/01/24 15:17:02, dak wrote: > > On 2020/01/24 14:11:59, Dan Eble wrote: > > > On 2020/01/24 14:06:22, hanwenn wrote: > > > > If the allocation cost becomes problematic, we can use another hashmap > > > instead. > > > > > > "We" could profile it and

Re: Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-24 Thread nine . fierce . ballads
On 2020/01/24 15:17:02, dak wrote: > On 2020/01/24 14:11:59, Dan Eble wrote: > > On 2020/01/24 14:06:22, hanwenn wrote: > > > If the allocation cost becomes problematic, we can use another hashmap > > instead. > > > > "We" could profile it and know before pushing whether it is worth it. > > I

Re: Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-24 Thread hanwenn
https://codereview.appspot.com/583390043/diff/551390044/lily/grob.cc File lily/grob.cc (right): https://codereview.appspot.com/583390043/diff/551390044/lily/grob.cc#newcode971 lily/grob.cc:971: int j = 0; On 2020/01/24 15:17:13, dak wrote: > vsize j = 0; > :-) Done.

Re: Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-24 Thread dak
https://codereview.appspot.com/583390043/diff/551390044/lily/grob.cc File lily/grob.cc (right): https://codereview.appspot.com/583390043/diff/551390044/lily/grob.cc#newcode971 lily/grob.cc:971: int j = 0; vsize j = 0; :-) https://codereview.appspot.com/583390043/

Re: Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-24 Thread dak
On 2020/01/24 14:11:59, Dan Eble wrote: > On 2020/01/24 14:06:22, hanwenn wrote: > > If the allocation cost becomes problematic, we can use another hashmap > instead. > > "We" could profile it and know before pushing whether it is worth it. I don't think that this is really performance-critical.

Re: Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-24 Thread nine . fierce . ballads
On 2020/01/24 14:06:22, hanwenn wrote: > If the allocation cost becomes problematic, we can use another hashmap instead. "We" could profile it and know before pushing whether it is worth it. https://codereview.appspot.com/583390043/

Re: Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-24 Thread hanwenn
Reviewers: dak, Message: On 2020/01/24 13:29:34, dak wrote: > Not sure about the speedup (we might have small sizes often enough that the > constant factor becomes relevant), but the code is quite a net win with regard > to obviously doing what it should do. It probably takes a whole lot more >

Simplify and speed up uniquify (issue 583390043 by hanw...@gmail.com)

2020-01-24 Thread dak
Not sure about the speedup (we might have small sizes often enough that the constant factor becomes relevant), but the code is quite a net win with regard to obviously doing what it should do. It probably takes a whole lot more allocation calls, but at least the impact on memory is just