{"id":36550447,"url":"https://github.com/liudanking/gmmpool","last_synced_at":"2026-01-12T06:33:23.376Z","repository":{"id":57504811,"uuid":"121096626","full_name":"liudanking/gmmpool","owner":"liudanking","description":"A multi level memory pool for Golang","archived":false,"fork":false,"pushed_at":"2018-03-01T10:05:33.000Z","size":5,"stargazers_count":44,"open_issues_count":1,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-22T09:12:33.753Z","etag":null,"topics":["golang","memory-pool","multilevel"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liudanking.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-11T07:16:09.000Z","updated_at":"2024-01-29T11:51:09.000Z","dependencies_parsed_at":"2022-09-19T10:01:00.176Z","dependency_job_id":null,"html_url":"https://github.com/liudanking/gmmpool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liudanking/gmmpool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liudanking%2Fgmmpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liudanking%2Fgmmpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liudanking%2Fgmmpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liudanking%2Fgmmpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liudanking","download_url":"https://codeload.github.com/liudanking/gmmpool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liudanking%2Fgmmpool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","memory-pool","multilevel"],"created_at":"2026-01-12T06:33:22.519Z","updated_at":"2026-01-12T06:33:23.370Z","avatar_url":"https://github.com/liudanking.png","language":"Go","readme":"# gmmpool\n\nA multi level memory pool for Golang:\n\n\n![](https://ws1.sinaimg.cn/large/44cd29dagy1fociejthjoj20n40ckgm0.jpg)\n\nThe design thoughts are detailed in [golang multi-level memory pool design and implemention](https://liudanking.com/arch/golang-multi-level-memory-pool-design-implementation/)(in Chinese🇨🇳).\n\n## Installation\n\n`go get github.com/liudanking/gmmpool`\n\n## Usage\n\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"log\"\n\n\t\"github.com/liudanking/gmmpool\"\n)\n\nfunc main() {\n\tpool := gmmpool.NewMultiLevelPool([]gmmpool.PoolOpt{\n\t\tgmmpool.PoolOpt{Num: 10, Size: 1024},     // level 0\n\t\tgmmpool.PoolOpt{Num: 10, Size: 1024 * 2}, // level 1\n\t})\n\n\tbuf := pool.Get(1025)\n\tdefer pool.Put(buf)\n\tdata, err := buf.ReadAll(bytes.NewReader(make([]byte, 8)))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Print(data)\n}\n\n\n```\n\n## Benchmark (compared with ioutil.ReadAll, x19 speed up)\n\n```\nBenchmarkStdReadAll-4             200000          5969 ns/op\nBenchmarkMultiLevelPool-4        5000000           311 ns/op\n```\n\n\n## Credit\n\n[goim](https://github.com/Terry-Mao/goim/)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliudanking%2Fgmmpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliudanking%2Fgmmpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliudanking%2Fgmmpool/lists"}