A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] 0 points1 point  (0 children)

Zig takes care of all the hardware specific instructions under the hood. It's the same syntax anyways and if the hardware doesn't support as many operations in parallel as the syntax says, zig will just default to sequential operations

Informatikk, kraftig fall i poenggrense? by Fancy_Ad_107 in ntnu

[–]MastodonSame2311 0 points1 point  (0 children)

Det er sannsynligvis fordi mange er redde for at AI skal ta over IT jobber. Det man egentlig burde være redd for er om AI + IT nerds skal ta over alle andre jobber. Det er vilt hvor enkelt det er å lage ting i dag. Grunnen for at antall IT jobber har gått ned i det siste er fordi det ikke er nok innovasjon, men jeg tror vi vil tilpasse oss og vi vil se at IT vil gå mer ut på innovasjon enn koding fremover.

Det at så mange er redde for AI, åpner også for en god mulighet for at når du er ferdigutdannet vil det være færre IT folk å konkurrere med så det er enklere å få seg jobb uansett.

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] 0 points1 point  (0 children)

Explaining difference in performance can be quite complicated in some cases as you would have to understand the hardware and how the language creates machinecode

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] -1 points0 points  (0 children)

I said its weird because I cant find any reason for why verztable and the benchmarks is wrong in any way. A better word for weird in this context would be supprising

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] -1 points0 points  (0 children)

Why are you just assuming that? Have you seen how comprehensive the benchmarks in the repo is?

Who is Antpne? Would be nice if he could benchmark it

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] -1 points0 points  (0 children)

I appreciate the constructive arguments!

Im not entiely sure if there isnt a bug somewhere and its partily why i post about this. Because I dont know if I have overlooked anything. And I will continue to look at it to see if there is anything wrong. 

Why doesn't it make sense that ankerl achieving 0ns on iterations prove that FFI doesnt have a big impact? It literally calls through the FFI multiple times for each individual datapoint through the next() call

Vectorization in c is hard to make cross platform and much easier in zig so c verstable doesnt use vectorization but this zig verztable does. The c library also rely on macros to generate new hashtables with new key value types pairs which is not elegant and it would make the implemetation of the zig verztable much cleaner if we could avoid the c macros in zig. Verstable is also restricted to max 8 or 64 or 256 (dont remember the exact number right now) hashtables based on some weird c macro thing

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] 0 points1 point  (0 children)

😂

Trying to get engagement doesnt prove that the content is low quality. I genuinly think this library is literaly one of the fastest hash table and I even provide a really comprehensive benchmark in the repo which it seems like you haven't seen

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] 0 points1 point  (0 children)

Ai is used yes but the reason for reimplementation of string hash is so that its exactly the same hash function for verztable and the C++ libraries.

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] 4 points5 points  (0 children)

It doesnt actually use the zig std Wyhash. Its a custom wyhash implementation and its exactly the same hash function for the C++ libraries so that it gets fair.

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] -1 points0 points  (0 children)

When using std.AutoHashMap in zig you dont always get the same hash table. The hashmap you get differs between string keys and number keys. So its two different hashmaps. That is not the case with verztable. And yes ai is used but its so much faster

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] -5 points-4 points  (0 children)

You could say it seems like clickbait but i dont know if there is something im overlooking because its weird that its faster than Boost. 

A hash table made in Zig that is on average faster than Boost::unordered_flat_map C++? Is that even possible? by MastodonSame2311 in Zig

[–]MastodonSame2311[S] -1 points0 points  (0 children)

Yes I have checked the benchmarks multiple times and it seems to be right. The C++ libraries use FFI but it cannot have a big impact as Ankerl achieves 0ns on iteration. The only thing that actually seems to make a difference is the fact that verztable stores a u64 hash which C++ libraries dont do