Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eatonphil/block-tax
Is there a block tax?
https://github.com/eatonphil/block-tax
Last synced: 3 days ago
JSON representation
Is there a block tax?
- Host: GitHub
- URL: https://github.com/eatonphil/block-tax
- Owner: eatonphil
- Created: 2023-12-04T14:40:51.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-12-04T14:45:29.000Z (12 months ago)
- Last Synced: 2024-10-13T04:13:06.153Z (about 1 month ago)
- Language: Rust
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Block Tax
NOTE: This must be run on Linux. This will drop your page cache. Your
system will act as if there was a fork bomb but it's not a fork
bomb. It will get back to normal after you run your normal programs
once.```
$ rustc blocktax.rs
$ ./blocktax | tee out.csv
$ duckdb -c "select column0, avg(column1) from 'out.csv' group by column0 order by avg(column1) asc"
┌──────────────────────────────┬────────────────────────┐
│ column0 │ avg(column1) │
│ varchar │ double │
├──────────────────────────────┼────────────────────────┤
│ full_page_4096 │ 2.2344517999999948e-05 │
│ full_page_512 │ 2.3091620400000006e-05 │
│ partial_page_4096_6144_bytes │ 2.5642358400000015e-05 │
│ partial_page_512_20_bytes │ 2.6037361999999975e-05 │
│ partial_page_512_768_bytes │ 3.0276204400000106e-05 │
│ 2_full_page_4096 │ 3.2619195599999956e-05 │
│ partial_page_4096_20_bytes │ 4.3916698800000013e-05 │
│ 2_full_page_512 │ 4.912078600000008e-05 │
└──────────────────────────────┴────────────────────────┘
$ # OR WITH 90TH PERCENTILE
$ duckdb -c "select column0, quantile(column1, .9) from 'out.csv' group by column0 order by quantile(column1, .9) a
sc"
┌──────────────────────────────┬───────────────────────┐
│ column0 │ quantile(column1, .9) │
│ varchar │ double │
├──────────────────────────────┼───────────────────────┤
│ full_page_4096 │ 2.1768e-05 │
│ full_page_512 │ 2.343e-05 │
│ partial_page_4096_6144_bytes │ 2.6171e-05 │
│ partial_page_4096_20_bytes │ 3.998e-05 │
│ partial_page_512_20_bytes │ 4.3407e-05 │
│ partial_page_512_768_bytes │ 5.2008e-05 │
│ 2_full_page_512 │ 7.8828e-05 │
│ 2_full_page_4096 │ 7.9737e-05 │
└──────────────────────────────┴───────────────────────┘
```