{"id":18977949,"url":"https://github.com/becheran/fast-hilbert","last_synced_at":"2025-04-19T17:34:28.592Z","repository":{"id":53284148,"uuid":"338169115","full_name":"becheran/fast-hilbert","owner":"becheran","description":"Fast Hilbert space-filling curve transformation using a LUT","archived":false,"fork":false,"pushed_at":"2025-04-07T20:16:30.000Z","size":77,"stargazers_count":41,"open_issues_count":6,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-07T21:25:38.372Z","etag":null,"topics":["benchmarking","fractal","hilbert","lut","rust","space-filling-curves"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/becheran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-11T22:27:28.000Z","updated_at":"2025-04-07T20:16:34.000Z","dependencies_parsed_at":"2023-02-09T20:30:43.803Z","dependency_job_id":null,"html_url":"https://github.com/becheran/fast-hilbert","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/becheran%2Ffast-hilbert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/becheran%2Ffast-hilbert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/becheran%2Ffast-hilbert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/becheran%2Ffast-hilbert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/becheran","download_url":"https://codeload.github.com/becheran/fast-hilbert/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249061702,"owners_count":21206545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmarking","fractal","hilbert","lut","rust","space-filling-curves"],"created_at":"2024-11-08T15:31:29.488Z","updated_at":"2025-04-16T11:31:34.656Z","avatar_url":"https://github.com/becheran.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fast Hilbert\n\n[![Build Status](https://github.com/becheran/fast-hilbert/workflows/Test/badge.svg)](https://github.com/becheran/fast-hilbert/actions?workflow=Test)\n[![doc](https://docs.rs/fast_hilbert/badge.svg)](https://docs.rs/fast_hilbert)\n[![crates.io](https://img.shields.io/crates/v/fast_hilbert.svg)](https://crates.io/crates/fast_hilbert)\n[![usage](https://badgen.net/crates/d/fast_hilbert)](https://crates.io/crates/fast_hilbert)\n[![license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nFast Hilbert 2D curve computation using an efficient *Lookup Table (LUT)* and only considering the lowest order for a given input.\n\n![h1](./doc/h1.png)\n![h2](./doc/h2.png)\n![h3](./doc/h3.png)\n![h4](./doc/h4.png)\n![h5](./doc/h5.png)\n![h6](./doc/h6.png)\n\n* Convert from discrete 2D space to 1D hilbert space and reverse\n* Generalized for different unsigned integer input types (thanks [DoubleHyphen](https://github.com/DoubleHyphen) [PR#3](https://github.com/becheran/fast-hilbert/pull/3))\n* Speedup via lowest order computation (thanks [DoubleHyphen](https://github.com/DoubleHyphen) [PR#2](https://github.com/becheran/fast-hilbert/pull/2))\n* Very fast using an efficient 512 Byte *LUT*\n* No additional dependency\n\nBenchmarking the conversion from full 256x256 discrete 2D space to the 1D hilbert space, shows that *fast_hilbert* more than **twice as fast** compared to the fastest 2D hilbert transformation libs written in rust. Benchmarked on a *Intel i5-6400 CPU @ 2.70 GHz, 4 Cores* with *8 GB RAM*:\n\n| Library                                                | Time        | Description       |\n ------------------------------------------------------- |------------:| ----------------- |\n| **fast_hilbert**                                       |  **0.7 ms** | Optimized for fast computation in 2D discrete space using an efficient *LUT*\n| [hilbert_2d](https://crates.io/crates/hilbert_2d)      |  2.5 ms     | Also allows other variants such as *Moore* and *LIU* |\n| [hilbert_curve](https://crates.io/crates/hilbert_curve)|   2.0 ms    | Implements algorithm described on [Wikipedia](https://en.wikipedia.org/wiki/Hilbert_curve) |\n| [hilbert](https://crates.io/crates/hilbert)            |  32.1 ms    | Allows computation of higher dimensional Hilbert curves |\n\nEspecially for higher orders **fast_hilbert** outperforms other libraries by using only the next lowest relevant order instead of computing the hilbert curve bit per bit for the given input. See PR [#2](https://github.com/becheran/fast-hilbert/pull/2) and [#9](https://github.com/becheran/fast-hilbert/pull/9) for more details.\n\nFor example the computation of `xy2h(1, 2, 64)` is very fast to compute using `fast_hilbert` compared to a higher x,y pair such as `xy2h(u32::MAX-1, u32::MAX-2, 64)`:\n\n| Library          | x=1, y=2, order=64  | x=u32::MAX-1, y=u32::MAX-2, order=64    |\n ----------------- | ------------------: | --------------------------------------: |\n| **fast_hilbert** |  **4 ns**           | **32 ns**                               |\n| hilbert_2d       |  73 ns              | 72 ns                                   |\n| hilbert_curve    |  67 ns              | 49 ns                                   |\n| hilbert          |  690 ns             | 680 ns                                  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbecheran%2Ffast-hilbert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbecheran%2Ffast-hilbert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbecheran%2Ffast-hilbert/lists"}