Skip to content

Comment on Making a Python interpreter in 1024 bytesparent

Comments

because even if you do insertion only you have to do a linear probe to find duplicates.

Yes, but that is almost free for the first insert and need not be much work for the second and third. Also, that naive implementation will use less memory.

The kind of benchmark I was thinking of are the “large_random” and “Kostyra” ones from https://github.com/simdjson/json_benchmark_results that parse arrays of small objects with very short keys.

For such objects, as I said, it wouldn’t surprise me _much_ if the extremely naive implementation were faster.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.