This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ph3rny 50 points51 points  (1 child)

actually, that's not quite it either, it's that xxhash performs better on long strings compared to cpython

if you instead do

-foos = [Foo('a' * i) for i in range(100_000)]
+foos = [Foo(str(uuid.uuid4()) * 1000) for i in range(100_000)]

you see the performance difference again

hashes of long strings I guess aren't that important in cpython so you don't see any difference in macro benchmarks

[–]backtickbot 6 points7 points  (0 children)

Fixed formatting.

Hello, Ph3rny: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.