{"id":16499429,"url":"https://github.com/tpapp/objectpools.jl","last_synced_at":"2025-03-01T18:21:04.703Z","repository":{"id":55588527,"uuid":"219512453","full_name":"tpapp/ObjectPools.jl","owner":"tpapp","description":"An implementation of user-managed object pools in Julia.","archived":false,"fork":false,"pushed_at":"2020-12-20T09:17:26.000Z","size":5,"stargazers_count":6,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T16:20:12.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-04T13:50:17.000Z","updated_at":"2023-05-23T22:06:10.000Z","dependencies_parsed_at":"2022-08-15T03:50:20.808Z","dependency_job_id":null,"html_url":"https://github.com/tpapp/ObjectPools.jl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FObjectPools.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FObjectPools.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FObjectPools.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FObjectPools.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpapp","download_url":"https://codeload.github.com/tpapp/ObjectPools.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241405077,"owners_count":19957764,"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":[],"created_at":"2024-10-11T14:52:46.074Z","updated_at":"2025-03-01T18:21:04.661Z","avatar_url":"https://github.com/tpapp.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ObjectPools.jl\n\n![Lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)\u003c!--\n![Lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)\n![Lifecycle](https://img.shields.io/badge/lifecycle-stable-green.svg)\n![Lifecycle](https://img.shields.io/badge/lifecycle-retired-orange.svg)\n![Lifecycle](https://img.shields.io/badge/lifecycle-archived-red.svg)\n![Lifecycle](https://img.shields.io/badge/lifecycle-dormant-blue.svg) --\u003e\n[![Build Status](https://travis-ci.com/tpapp/ObjectPools.jl.svg?branch=master)](https://travis-ci.com/tpapp/ObjectPools.jl)\n[![codecov.io](http://codecov.io/github/tpapp/ObjectPools.jl/coverage.svg?branch=master)](http://codecov.io/github/tpapp/ObjectPools.jl?branch=master)\n\nAn implementation of user-managed object pools in Julia.\n\n# Overview\n\nThis package is designed for use cases where some *inner* functions would need to allocate a large number of arrays which would not escape an outer function `f`. An object pool allows the user to obtain new objects with the `new!`, then allow them to be recycled with `recycle!`.\n\nConsider this (contrived) example:\n\n```julia\nfunction f(pool, x::AbstractVector{T}) where T\n    recycle!(pool)                   # reuse all arrays\n    S = float(T)\n    l = length(x)\n    y = new!(pool, Vector{S}, l)     # taken from pool\n    z = new!(pool, Matrix{S}, l, l)  # taken from pool\n    @. y = abs2(x)\n    z .= x .+ permutedims(x)\n    z * y                            # the only allocated array\nend\n```\n\n`pool = ArrayPool()` will save the relevant interim arrays and avoid allocation when necessary. If the function is called with various types, these will eventually accumulate too in `pool`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpapp%2Fobjectpools.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpapp%2Fobjectpools.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpapp%2Fobjectpools.jl/lists"}