Skip to content

Instantly share code, notes, and snippets.

View zamazan4ik's full-sized avatar
🐰
Let's dig into loosely-coupled event-driven systems

Alexander Zaitsev zamazan4ik

🐰
Let's dig into loosely-coupled event-driven systems
View GitHub Profile
zamazan4ik — Сегодня, в 19:43
Can please anyone point me where in CachyOS's build scripts LTO is enabled by default for packages?
ptr1337 — Сегодня, в 19:44
Thats default enabled in archlinux in its makepkg.conf:
https://github.com/CachyOS/docker-makepkg/blob/master/docker-makepkg-v3/makepkg.conf#L97
lto string here
zamazan4ik — Сегодня, в 19:45
Is it the same for Rust packages?
@zamazan4ik
zamazan4ik / gist:6c3286fef32b8f6f2bf31c1fd93d31a4
Created November 14, 2024 01:34
osmgraph: PGO optimized compared to Release
Running benches/graph.rs (x86_64-unknown-linux-gnu/release/deps/graph-106907e9f648f29b)
Benchmarking node_parse
Benchmarking node_parse: Warming up for 3.0000 s
Benchmarking node_parse: Collecting 100 samples in estimated 5.0786 s (258k iterations)
Benchmarking node_parse: Analyzing
node_parse time: [20.479 µs 20.630 µs 20.761 µs]
change: [-33.074% -32.663% -32.280%] (p = 0.00 < 0.05)
Performance has improved.
Found 23 outliers among 100 measurements (23.00%)
14 (14.00%) low severe
@zamazan4ik
zamazan4ik / gist:88ea481a6e7118147e52649e9b31f9ab
Created November 14, 2024 01:33
osmgraph: PGO instrumented compared to Release
Running benches/graph.rs (x86_64-unknown-linux-gnu/release/deps/graph-106907e9f648f29b)
Benchmarking node_parse
Benchmarking node_parse: Warming up for 3.0000 s
Benchmarking node_parse: Collecting 100 samples in estimated 5.3819 s (30k iterations)
Benchmarking node_parse: Analyzing
node_parse time: [184.15 µs 184.19 µs 184.22 µs]
change: [+498.11% +500.43% +502.91%] (p = 0.00 < 0.05)
Performance has regressed.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
Running benches/graph.rs (release/deps/graph-45a5fcf93f169c4d)
node_parse time: [30.069 µs 30.281 µs 30.520 µs]
Found 26 outliers among 100 measurements (26.00%)
16 (16.00%) low severe
3 (3.00%) high mild
7 (7.00%) high severe
way_parse time: [439.72 µs 440.01 µs 440.27 µs]
node_from_ways_parse time: [981.20 µs 981.73 µs 982.45 µs]
@zamazan4ik
zamazan4ik / gist:e6715b0aa352e9c16df68c6ba59c2eae
Created November 5, 2024 18:44
wondermagick: Release vs Release + LTO
bin_lto - a binary with Release + Fat LTO
bin_release - a binary with just Release
➜ target git:(main) ✗ hyperfine --warmup=3 './bin_release ./Sun_over_Lake_Hawea,_New_Zealand.jpg -thumbnail 120x120 ~/out.jpg' './bin_lto ./Sun_over_Lake_Hawea,_New_Zealand.jpg -th
Benchmark 1: ./bin_release ./Sun_over_Lake_Hawea,_New_Zealand.jpg -thumbnail 120x120 ~/out.jpg
Time (mean ± σ): 132.8 ms ± 0.9 ms [User: 97.8 ms, System: 34.3 ms]
Range (min … max): 131.7 ms … 135.3 ms 22 runs
Benchmark 2: ./bin_lto ./Sun_over_Lake_Hawea,_New_Zealand.jpg -thumbnail 120x120 ~/out.jpg
Time (mean ± σ): 132.6 ms ± 1.2 ms [User: 99.2 ms, System: 32.8 ms]
osmgraph git:(master) ✗ cargo test
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.22s
Running unittests src/lib.rs (target/debug/deps/osmgraph-7e055e3784e1272c)
running 5 tests
test graph::node::haversine_tests::test_berlin_paris ... ok
test graph::node::haversine_tests::test_equator_distance ... ok
test graph::node::haversine_tests::test_new_york_los_angeles ... ok
test graph::node::haversine_tests::test_poles_distance ... ok
test graph::node::haversine_tests::test_zero_distance ... ok
@zamazan4ik
zamazan4ik / gist:1a893ee4cc24c6ce9f9b61af0ca4a513
Created October 12, 2024 19:06
cosmic-text: PGO optimized compared to Release
Running benches/layout.rs (target/x86_64-unknown-linux-gnu/release/deps/layout-999027abf63f3284)
Benchmarking Wrap(None, Simple)/small amount of text
Benchmarking Wrap(None, Simple)/small amount of text: Warming up for 3.0000 s
Benchmarking Wrap(None, Simple)/small amount of text: Collecting 100 samples in estimated 5.0115 s (1.4M iterations)
Benchmarking Wrap(None, Simple)/small amount of text: Analyzing
Wrap(None, Simple)/small amount of text
time: [3.4443 µs 3.4514 µs 3.4581 µs]
change: [-12.468% -12.216% -12.008%] (p = 0.00 < 0.05)
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
@zamazan4ik
zamazan4ik / gist:c03e81a8fa4b1db532d68abf8bf59939
Created October 12, 2024 18:53
cosmic-text: PGO instrumented compared to Release
Running benches/layout.rs (target/x86_64-unknown-linux-gnu/release/deps/layout-999027abf63f3284)
Benchmarking Wrap(None, Simple)/small amount of text
Benchmarking Wrap(None, Simple)/small amount of text: Warming up for 3.0000 s
Benchmarking Wrap(None, Simple)/small amount of text: Collecting 100 samples in estimated 5.0305 s (667k iterations)
Benchmarking Wrap(None, Simple)/small amount of text: Analyzing
Wrap(None, Simple)/small amount of text
time: [7.5341 µs 7.5397 µs 7.5486 µs]
change: [+91.869% +92.786% +94.031%] (p = 0.00 < 0.05)
Performance has regressed.
Found 16 outliers among 100 measurements (16.00%)
Running benches/layout.rs (target/release/deps/layout-3c8df2008110b5db)
Wrap(None, Simple)/small amount of text
time: [3.9176 µs 3.9329 µs 3.9578 µs]
Found 21 outliers among 100 measurements (21.00%)
2 (2.00%) high mild
19 (19.00%) high severe
Wrap(None, Simple)/large amount of text
time: [4.3545 ms 4.3613 ms 4.3721 ms]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
@zamazan4ik
zamazan4ik / gist:77da0e61d3279b3c35206c0f6a4b3490
Created October 12, 2024 14:58
sqlite speedtest: Clang PGO + BOLT optimized
taskset -c 0 ./speedtest_clang_pgo_and_bolt_optimized --shrink-memory --reprepare --stats --heap 10000000 64 --size 200
100 - 100000 INSERTs into table with no index..................... 0.093s
110 - 100000 ordered INSERTS with one index/PK.................... 0.125s
120 - 100000 unordered INSERTS with one index/PK.................. 0.154s
130 - 25 SELECTS, numeric BETWEEN, unindexed...................... 0.123s
140 - 10 SELECTS, LIKE, unindexed................................. 0.130s
142 - 10 SELECTS w/ORDER BY, unindexed............................ 0.222s
145 - 10 SELECTS w/ORDER BY and LIMIT, unindexed.................. 0.111s
150 - CREATE INDEX five times..................................... 0.171s