TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hashmaps in Factor are faster than in Zig

180 pointsby kencauseyover 1 year ago

7 comments

senderistaover 1 year ago
I don&#x27;t see a compelling reason to use tombstones in linear probing except in a concurrent context (where you can&#x27;t move entries around). The tombstone-free deletion algorithm is quite simple: <a href="https:&#x2F;&#x2F;github.com&#x2F;senderista&#x2F;hashtable-benchmarks&#x2F;blob&#x2F;master&#x2F;src&#x2F;main&#x2F;java&#x2F;set&#x2F;int64&#x2F;LPLongHashSet.java#L184">https:&#x2F;&#x2F;github.com&#x2F;senderista&#x2F;hashtable-benchmarks&#x2F;blob&#x2F;mast...</a>. No rehashing is necessary.
评论 #38228959 未加载
评论 #38227802 未加载
评论 #38227813 未加载
评论 #38236386 未加载
lll-o-lllover 1 year ago
Hash maps are such a fundamentally important data structure that it comes as a surprise that the Zig implementation is so broken. Good to see it’s getting fixed, but surprising that this wasn’t detected before.
评论 #38228361 未加载
评论 #38228826 未加载
评论 #38230014 未加载
评论 #38228058 未加载
评论 #38230933 未加载
Dweditover 1 year ago
So in other words, bug in Zig library causes linear execution time on something that isn&#x27;t supposed to be linear.
chmod600over 1 year ago
Factor looks cool, but what&#x27;s it really about? Can someone who loves the language explain why?
评论 #38230749 未加载
评论 #38228183 未加载
评论 #38229348 未加载
zelphirkaltover 1 year ago
Not a good showcase of Factor code. All variable names 1 letter, seemingly simply chosen subsequent letters in the alphabet, instead of any names, that would indicate what the code does.
评论 #38231336 未加载
kencauseyover 1 year ago
Title is a bit clickbait. This is regarding Hashmaps specifically. Read or at least scan through it where the author will submit a fix for the Zig implementation resulting in Zig&#x27;s Hashmap being 50% faster than the Factor implementation.
评论 #38226071 未加载
benatkinover 1 year ago
Why hashmaps? Python has named tuples.<p>Oh - this puts a lot of keys into one hashmap, not a ton of objects with the same keys. :)
评论 #38227806 未加载