It is just a small optimization. Instead of manually copying all
elements from one set over to the other, the update method of rdict is
used. This optimization has already been there before I added strategies
for sets. I think it just got lost when I rewrote the W_SetObject
implementation. The same optimization is also used for the update method
of W_DictMultiObject. I guess the rdict is a little more optimized for
that task.

You are right. There wasn't a test checking this specific path (updating
an object set with another object set). So I added one.

- Lukas

Am 19.06.2012 19:47, schrieb David Edelsohn:
> On Tue, Jun 19, 2012 at 12:33 PM, Lukas Diekmann
> <lukas.diekm...@uni-duesseldorf.de> wrote:
>> Hi,
>>
>> you are right. Union between two sets of objects are slower, since we
>> introduced mechanics to make set operations with primitive types (e.g. ints)
>> faster.
>> The problem was that a fastpath was removed in that process. I readded it.
>> Union/Update with sets of objects should be fast again in the future.
>>
>> Thank you for figuring that out. Your program was very helpful.
>>
>> Commit: https://bitbucket.org/pypy/pypy/changeset/452bb2805140
> Lukas,
>
> Should the restored code include a comment about why the fast path is
> useful for non-primitive types? Or a new test to ensure the optimal IR
> is generated?
>
> - David
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to