clf
Flush the data cache line.
This crate can be used when you do benchmarks that are not dependent on the cpu cache.
Supports
- x86_64, aarch64 (native implementation)
- mips64el, powerpc64le ... etc (fallback to
__builtin_clear_cache) - minimum support rustc 1.70.0 (due to
core::archandasm!)
Examples
Easy to use:
let a = vec!;
cache_line_flush_with_slice;
or
let a = vec!;
let begin_ptr = a.as_ptr;
let end_ptr = unsafe ;
unsafe ;
References
Benchmarking
To measure the effectiveness of the cache flushing, you can run the included benchmarks:
make bench
This will compare the access time of "warm" data versus "flushed" data.
Changelogs
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.