https://github.com/crystal-lang/perf-tools
An assortment of tools to track resources in Crystal applications
https://github.com/crystal-lang/perf-tools
Last synced: 3 months ago
JSON representation
An assortment of tools to track resources in Crystal applications
- Host: GitHub
- URL: https://github.com/crystal-lang/perf-tools
- Owner: crystal-lang
- License: mit
- Created: 2023-08-25T14:28:18.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-12T12:05:58.000Z (9 months ago)
- Last Synced: 2025-03-07T02:46:30.784Z (3 months ago)
- Language: Crystal
- Homepage:
- Size: 39.1 KB
- Stars: 27
- Watchers: 7
- Forks: 3
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# perf-tools
An assortment of tools to track resources in Crystal applications.
## Usage
To log the number of allocations, objects, their sizes, or their linking graph:
```crystal
require "perf_tools/mem_prof"PerfTools::MemProf.log_object_counts(STDOUT)
PerfTools::MemProf.log_object_sizes(STDOUT)
PerfTools::MemProf.log_allocations(STDOUT)
PerfTools::MemProf.pretty_log_allocations(STDOUT)
PerfTools::MemProf.pretty_log_object_graph(STDOUT)
```To log all fibers:
```crystal
require "perf_tools/fiber_trace"PerfTools::FiberTrace.log_fibers(STDOUT)
PerfTools::FiberTrace.pretty_log_fibers(STDOUT)
```Check each tool's instructions for more information.
## Installation
Add this to your application's `shard.yml`:
```yml
development_dependencies:
perf_tools:
github: crystal-lang/perf-tools
```## Contributing
1. Fork it ( )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request