Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/llogiq/smallvectune
https://github.com/llogiq/smallvectune
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/llogiq/smallvectune
- Owner: llogiq
- License: apache-2.0
- Created: 2018-08-31T10:45:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-15T21:28:58.000Z (over 6 years ago)
- Last Synced: 2024-09-14T10:36:26.610Z (3 months ago)
- Language: Rust
- Size: 19.5 KB
- Stars: 9
- Watchers: 5
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Tune your SmallVecs!
*This is a Work In Progress. Issues and Pull Requests Welcome!*
You can use this crate to get information on how your code uses `SmallVec`s.
What it does is writing a log of all SmallVec constructions, resizings and
destructions by array size.Each line in the log is composed of `;;;[+/-];;`, where the first item is the
size of the array's item type, the second is the array size (we can use this to
distinguish various smallvec uses within one application), the third is `+` for
a new allocation, `-` for a deallocation and space on resize, and the fourth
and fifth are the capacity before and after the operation (if any).For example, creating a smallvec of `u8`, extending and dropping it may create
the following log (here annotated for clarity):```
0;1;1;+;;1 # create
0;1;1; ;1;100 # extend (allocate+deallocate)
0;1;1;-;100 # drop
```# License
# Usage
In your `Cargo.toml`, replace your `smallvec` dependency with `smallvectune`. Then
in your lib.rs (or main.rs), replace `extern crate smallvec;` with
`extern crate smallvectune as smallvec;`.Calling your code, you'll have to set the `SMALLVECTUNE_OUT` environment variable
to a valid path to write to. This is where the log will be written.# License
This is under Apache/2 or MIT license, per your choice. All contributions
are also given under the same license.