{"id":13607916,"url":"https://github.com/shawnsmithdev/zermelo","last_synced_at":"2025-04-12T14:31:31.500Z","repository":{"id":16721500,"uuid":"19478517","full_name":"shawnsmithdev/zermelo","owner":"shawnsmithdev","description":"A radix sorting library for Go (golang)","archived":false,"fork":false,"pushed_at":"2023-08-10T20:22:34.000Z","size":208,"stargazers_count":51,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-07T13:38:10.583Z","etag":null,"topics":["go","radix-sort","sorting"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mkremins/fanciful","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shawnsmithdev.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2014-05-06T02:34:13.000Z","updated_at":"2024-10-20T17:15:02.000Z","dependencies_parsed_at":"2024-04-16T07:47:57.183Z","dependency_job_id":"aa2f3dd6-c907-4872-afe9-f78bef9937dd","html_url":"https://github.com/shawnsmithdev/zermelo","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fzermelo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fzermelo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fzermelo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fzermelo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shawnsmithdev","download_url":"https://codeload.github.com/shawnsmithdev/zermelo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248581167,"owners_count":21128113,"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":["go","radix-sort","sorting"],"created_at":"2024-08-01T19:01:22.756Z","updated_at":"2025-04-12T14:31:28.835Z","avatar_url":"https://github.com/shawnsmithdev.png","language":"Go","readme":"zermelo v2 \n=========\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/shawnsmithdev/zermelo/v2)\n[![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/shawnsmithdev/zermelo/master/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/shawnsmithdev/zermelo/v2)](https://goreportcard.com/report/github.com/shawnsmithdev/zermelo/v2)\n\nA radix sorting library for Go.  Trade memory for speed! Now with more generics!\n\n```go\nimport \"github.com/shawnsmithdev/zermelo/v2\"\n\nfunc foo(large []uint64)\n    zermelo.Sort(large)\n}\n```\n\nAbout\n=====\n\nZermelo is a sorting library featuring implementations of \n[radix sort](https://en.wikipedia.org/wiki/Radix_sort \"Radix Sort\"). I am especially influenced here by \n[these](http://codercorner.com/RadixSortRevisited.htm \"Radix Sort Revisited\") \n[two](http://stereopsis.com/radix.html \"Radix Tricks\") articles that describe various optimizations and how to work\naround the typical limitations of radix sort.\n\nYou will generally only want to use zermelo if you won't mind the extra memory used for buffers and your application\nfrequently sorts slices of supported types with at least 256 elements (128 for 32-bit types, 386 for `[]float64`).\nThe larger the slices you are sorting, the more benefit you will gain by using zermelo instead of the standard library's\nin-place comparison sort [`slices.Sort()`](https://pkg.go.dev/slices#Sort).\n\nEtymology\n---------\nZermelo is named after [Ernst Zermelo](http://en.wikipedia.org/wiki/Ernst_Zermelo), who developed the proof for the\n[well-ordering theorem](https://en.wikipedia.org/wiki/Well-ordering_theorem).\n\nSupported Types\n===============\n`Sort` and `NewSorter` support integer slices, that is `[]int`, `[]uint64`, `[]byte`, etc, and derived types.\n\nSorter\n======\n\nA `Sorter` returned by `NewSorter` will reuse buffers created during `Sort()` calls. This is not thread safe.\nBuffers are grown as needed at a 25% exponential growth rate.  This means if you sort a slice of size `n`,\nsubsequent calls with slices up to `n * 1.25` in length will not cause another buffer allocation. This does not apply\nto the first allocation, which will make a buffer of the same size as the requested slice. This way, if the slices being\nsorted do not grow in size, there is no unused buffer space.\n\n```go\nimport \"github.com/shawnsmithdev/zermelo/v2\"\n\nfunc foo(bar [][]uint64) {\n    sorter := zermelo.NewSorter[uint64]()\n    for _, x := range bar {\n        sorter.Sort(x)\n    }\n}\n\n```\n\nFloat Subpackage\n================\n`SortFloats` and `FloatSorter` provided in the `floats` subpackage support float slices,\nspecifically `[]float32` and `[]float64` and derived types.\nThis uses the unsafe package to treat floats as though they were unsigned integers.\n\n```go\nimport \"github.com/shawnsmithdev/zermelo/v2/floats\"\n\nfunc foo(bar [][]floats64) {\n    sorter := floats.NewFloatSorter[float64]()\n    for _, x := range bar {\n        sorter.Sort(x)\n    }\n}\n```\n","funding_links":[],"categories":["Algorithm"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnsmithdev%2Fzermelo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshawnsmithdev%2Fzermelo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnsmithdev%2Fzermelo/lists"}