{"id":20481153,"url":"https://github.com/piotrmurach/benchmark-malloc","last_synced_at":"2025-08-20T10:32:42.295Z","repository":{"id":59151033,"uuid":"179569652","full_name":"piotrmurach/benchmark-malloc","owner":"piotrmurach","description":"Trace memory allocations and collect stats","archived":false,"fork":false,"pushed_at":"2024-03-13T23:00:03.000Z","size":42,"stargazers_count":20,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-10T11:37:23.840Z","etag":null,"topics":["benchmark","malloc","performance-analysis","ruby","rubygem"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/piotrmurach.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"piotrmurach"}},"created_at":"2019-04-04T20:09:54.000Z","updated_at":"2024-06-05T23:06:40.000Z","dependencies_parsed_at":"2024-03-14T00:23:05.288Z","dependency_job_id":"40c83296-1cfd-4958-b0a7-46450990743a","html_url":"https://github.com/piotrmurach/benchmark-malloc","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.025000000000000022","last_synced_commit":"028178bddc4c1b908d496e0e9d5e8d32dd95b595"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Fbenchmark-malloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Fbenchmark-malloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Fbenchmark-malloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Fbenchmark-malloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piotrmurach","download_url":"https://codeload.github.com/piotrmurach/benchmark-malloc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230415318,"owners_count":18222158,"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":["benchmark","malloc","performance-analysis","ruby","rubygem"],"created_at":"2024-11-15T16:06:59.709Z","updated_at":"2024-12-19T10:09:59.427Z","avatar_url":"https://github.com/piotrmurach.png","language":"Ruby","readme":"# Benchmark::Malloc\n\n[![Gem Version](https://badge.fury.io/rb/benchmark-malloc.svg)][gem]\n[![Actions CI](https://github.com/piotrmurach/benchmark-malloc/workflows/CI/badge.svg?branch=master)][gh_actions_ci]\n[![Build status](https://ci.appveyor.com/api/projects/status/cp102e33c2a7fx83?svg=true)][appveyor]\n[![Maintainability](https://api.codeclimate.com/v1/badges/d8fbd4a0423fd78d8bee/maintainability)][codeclimate]\n[![Coverage Status](https://coveralls.io/repos/github/piotrmurach/benchmark-malloc/badge.svg?branch=master)][coverage]\n[![Inline docs](https://inch-ci.org/github/piotrmurach/benchmark-malloc.svg?branch=master)][inchpages]\n\n[gem]: https://badge.fury.io/rb/benchmark-malloc\n[gh_actions_ci]: https://github.com/piotrmurach/benchmark-malloc/actions?query=workflow%3ACI\n[appveyor]: https://ci.appveyor.com/project/piotrmurach/benchmark-malloc\n[codeclimate]: https://codeclimate.com/github/piotrmurach/benchmark-malloc/maintainability\n[coverage]: https://coveralls.io/github/piotrmurach/benchmark-malloc?branch=master\n[inchpages]: https://inch-ci.org/github/piotrmurach/benchmark-malloc\n\n\u003e Trace memory allocations and collect stats.\n\nThe **Benchmark::Malloc** is used by [rspec-benchmark](https://github.com/piotrmurach/rspec-benchmark)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'benchmark-malloc'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install benchmark-malloc\n\n## Usage\n\n```ruby\nbench_malloc = Benchmark::Malloc.new\n\nstats = bench_malloc.run { %w[foo bar baz].sort[1] }\n\nstats.allocated.total_objects # =\u003e 3\n\nstats.allocated.total_memory # =\u003e 120\n```\n\n## API\n\n### start \u0026 stop\n\nYou can manually begin tracing memory allocations with the `start` method:\n\n```ruby\nmalloc = Benchmark::Malloc.new\nmalloc.start\n```\n\nAny Ruby code after the `start` invocation will count towards the stats:\n\n```ruby\n%w[foo bar baz].sort[1]\n```\n\nFinally, to finish tracing call the `stop` method:\n\n```ruby\nmalloc.stop\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/piotrmurach/benchmark-malloc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/piotrmurach/benchmark-malloc/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Benchmark::Malloc project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/piotrmurach/benchmark-malloc/blob/master/CODE_OF_CONDUCT.md).\n\n## Copyright\n\nCopyright (c) 2019 Piotr Murach. See LICENSE for further details.\n","funding_links":["https://github.com/sponsors/piotrmurach"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrmurach%2Fbenchmark-malloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiotrmurach%2Fbenchmark-malloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrmurach%2Fbenchmark-malloc/lists"}