{"id":61835,"date":"2026-06-03T17:13:30","date_gmt":"2026-06-03T14:13:30","guid":{"rendered":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/"},"modified":"2026-06-03T17:13:30","modified_gmt":"2026-06-03T14:13:30","slug":"efficient-hashing","status":"publish","type":"mod","link":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/","title":{"rendered":"EfficientHashing"},"content":{"rendered":"<p># EfficientHashing<\/p>\n<p>EfficientHashing replaced hashing algorithm of `Vec3i` (and its subclasses like `BlockPos`) with one that&#8217;s much much<br \/>\nmore collision resistant, providing performance improvement in basically wherever its hashcode is used.<\/p>\n<p>### Collision Resistant<\/p>\n<p>We can prove this by doing a simple test. Test is perform by hashing every combination of `BlockPos` between<br \/>\n`new BlockPos(-100, -20, -100)` and `new BlockPos(100, 50, 100)` (inclusive), with the total object count reaching<br \/>\n2,800,000+.<\/p>\n<p>Vanilla algorithm produced 194,571 unique hashcode in total. This means that at least 93% of all BlockPos hashcode are<br \/>\ncolliding with each other.<\/p>\n<p>And PhiMix, the algorithm used by EfficientHashing, produced 2868471 unique hashcode in total. This means that every<br \/>\nunique BlockPos object gets its unique hashcode, and NONE of all BlockPos hashcode are colliding.<\/p>\n<p>|                  | Unique Hashcode | Collision | Collision Rate |<br \/>\n|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;|&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;|&#8212;&#8212;&#8212;&#8211;|&#8212;&#8212;&#8212;&#8212;&#8212;-|<br \/>\n| Vanilla          | 194,571         | 2,673,900 | 93.2%          |<br \/>\n| EfficientHashing | 2,868,471       | 0         | 0%             |<\/p>\n<p>If you&#8217;re curious about the actual test code, see: here<\/p>\n<p>### Performant<\/p>\n<p>Benchmark time:<\/p>\n<p>&#8220;`<br \/>\nBenchmark                     Mode  Cnt   Score   Error  Units<br \/>\nVecHashingBenchmark.mixin    thrpt    5  47.012 \u00b1 1.029  ops\/s<br \/>\nVecHashingBenchmark.vanilla  thrpt    5  49.326 \u00b1 1.507  ops\/s<br \/>\n&#8220;`<\/p>\n<p>PhiMix is about 95.3% the performance of original hashing algorithm. Yes, it&#8217;s slower, but this performance gap is<br \/>\nrelatively tiny compared to other hashing solution, and can be easily outweighed by the significant improvement in hash<br \/>\ncollision resistance.<\/p>\n<p>If you&#8217;re curious about the actual benchmark code, see: here<\/p>\n<p>### Vanilla compatible<\/p>\n<p>In vanilla hashing algorithm, if you hash the &#8220;default&#8221; instance of `BlockPos`\/`Vec3i`, aka `new BlockPos(0, 0, 0)`, the<br \/>\nproduced hashcode will be `0`, which happens to be the &#8220;default&#8221; instance of integer. This special behavior is also<br \/>\npresent in PhiMix, providing the best possible vanilla compatibility.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>better hashing algorithm for Vec3i &#038; BlockPos<\/p>\n","protected":false},"featured_media":61836,"template":"","meta":{"_minecraft_slug":"efficient-hashing","_minecraft_project_id":"zEcqovh2","_minecraft_author":"ZZZank","_minecraft_license":"LGPL-3.0-only","_minecraft_downloads":115750,"_minecraft_follows":10,"_minecraft_client_side":"required","_minecraft_server_side":"required","_minecraft_storage_type":"zip","_minecraft_archive_name":"efficient-hashing.zip","_minecraft_size_bytes":172266,"_minecraft_version_count":8,"_minecraft_updated_at":"2026-05-16T23:30:54.624805Z","_minecraft_date_created":"2025-12-01T06:01:46.993743Z","_minecraft_date_modified":"2025-11-28T16:51:42.882700Z","_minecraft_project_url":"https:\/\/modrinth.com\/mod\/efficient-hashing","_minecraft_icon_attachment_id":61836,"_minecraft_imported_at":"2026-06-03T14:13:31+00:00","_minecraft_import_hash":"3ddcf0d0c9262f898b80df5794568856","_minecraft_versions":"","_minecraft_links":"","_minecraft_gallery":"","_minecraft_api_metadata":""},"mod_category":[97,104,158,90],"mod_loader":[99],"minecraft_version":[51,52,53,54,55,56,57,58,59,36,62,37],"class_list":["post-61835","mod","type-mod","status-publish","has-post-thumbnail","hentry","mod_category-fabric","mod_category-forge","mod_category-neoforge","mod_category-optimization","mod_loader-fabric","minecraft_version-1-18","minecraft_version-1-18-1","minecraft_version-1-18-2","minecraft_version-1-19","minecraft_version-1-19-1","minecraft_version-1-19-2","minecraft_version-1-19-3","minecraft_version-1-19-4","minecraft_version-1-20","minecraft_version-1-20-1","minecraft_version-1-21","minecraft_version-1-21-1"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>EfficientHashing - Minecraft<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"EfficientHashing - Minecraft\" \/>\n<meta property=\"og:description\" content=\"better hashing algorithm for Vec3i &amp; BlockPos\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/\" \/>\n<meta property=\"og:site_name\" content=\"Minecraft\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/efficient-hashing\\\/\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/efficient-hashing\\\/\",\"name\":\"EfficientHashing - Minecraft\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/efficient-hashing\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/efficient-hashing\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/efficient-hashing-icon-f8e4a9bdb5ed6270b8e8ff4709fdd7c7638ceea6_96.webp\",\"datePublished\":\"2026-06-03T14:13:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/efficient-hashing\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/efficient-hashing\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/efficient-hashing\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/efficient-hashing-icon-f8e4a9bdb5ed6270b8e8ff4709fdd7c7638ceea6_96.webp\",\"contentUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/efficient-hashing-icon-f8e4a9bdb5ed6270b8e8ff4709fdd7c7638ceea6_96.webp\",\"width\":96,\"height\":96},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/efficient-hashing\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mods\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"EfficientHashing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\",\"name\":\"Minecraft\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"EfficientHashing - Minecraft","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/","og_locale":"en_US","og_type":"article","og_title":"EfficientHashing - Minecraft","og_description":"better hashing algorithm for Vec3i & BlockPos","og_url":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/","og_site_name":"Minecraft","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/","url":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/","name":"EfficientHashing - Minecraft","isPartOf":{"@id":"https:\/\/vpesports.com\/minecraft\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/#primaryimage"},"image":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/#primaryimage"},"thumbnailUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/efficient-hashing-icon-f8e4a9bdb5ed6270b8e8ff4709fdd7c7638ceea6_96.webp","datePublished":"2026-06-03T14:13:30+00:00","breadcrumb":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/#primaryimage","url":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/efficient-hashing-icon-f8e4a9bdb5ed6270b8e8ff4709fdd7c7638ceea6_96.webp","contentUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/efficient-hashing-icon-f8e4a9bdb5ed6270b8e8ff4709fdd7c7638ceea6_96.webp","width":96,"height":96},{"@type":"BreadcrumbList","@id":"https:\/\/vpesports.com\/minecraft\/mods\/efficient-hashing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vpesports.com\/minecraft\/"},{"@type":"ListItem","position":2,"name":"Mods","item":"https:\/\/vpesports.com\/minecraft\/mods\/"},{"@type":"ListItem","position":3,"name":"EfficientHashing"}]},{"@type":"WebSite","@id":"https:\/\/vpesports.com\/minecraft\/#website","url":"https:\/\/vpesports.com\/minecraft\/","name":"Minecraft","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vpesports.com\/minecraft\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod\/61835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod"}],"about":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/types\/mod"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media\/61836"}],"wp:attachment":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media?parent=61835"}],"wp:term":[{"taxonomy":"mod_category","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_category?post=61835"},{"taxonomy":"mod_loader","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_loader?post=61835"},{"taxonomy":"minecraft_version","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/minecraft_version?post=61835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}