I'll fix this for the next release. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord Sent: Thursday, February 28, 2008 2:04 PM To: Discussion of IronPython Subject: [IronPython] Hashing in IronPython
At Resolver Systems we are seeing IronPython use a radically lower amount of unique hashes for tuples - which we *believe* may be at the root of a performance problem with using dictionaries keyed by tuples. CPython 2.5 >>> hashes = set() >>> for i in range(1000): ... for j in range(1000): ... hashes.add(hash((i, j))) ... >>> len(hashes) 1000000 Same code on IronPython 2: IronPython 2.0 Alpha (2.0.0.800) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> hashes = set() >>> for i in range(1000): ... for j in range(1000): ... hashes.add(hash((i, j))) ... >>> len(hashes) 32768 >>> We have a work around (using 2D arrays instead of dictionaries) but as dictionaries are heavily used in Python it is likely to be a problem for others as well. All the best, Michael Foord http://www.manning.com/foord _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
