pydata / sparse

Sparse multi-dimensional arrays for the PyData ecosystem
https://sparse.pydata.org
BSD 3-Clause "New" or "Revised" License
602 stars 126 forks source link

ENH: Add counting triangles example #781

Closed mtsokol closed 1 month ago

mtsokol commented 1 month ago

Hi @hameerabbasi,

Here's a short example that runs counting triangles with Finch, SciPy, and NetworkX. Two comments:

codspeed-hq[bot] commented 1 month ago

CodSpeed Performance Report

Merging #781 will degrade performances by 25.26%

Comparing triangles-example (733f44b) with main (a60f0ad)

Summary

❌ 7 regressions ✅ 333 untouched benchmarks

:warning: Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main triangles-example Change
test_index_slice[side=100-rank=2-format='gcxs'] 2.4 ms 3.2 ms -25.26%
test_elemwise[f=<built-in function add>-backend='Finch'-side=1000] 1.5 ms 1.7 ms -11.83%
test_elemwise[f=<built-in function add>-backend='Finch'-side=100] 728.4 µs 925.2 µs -21.27%
test_elemwise[f=<built-in function add>-backend='Finch'-side=500] 893.8 µs 1,094 µs -18.3%
test_elemwise[f=<built-in function mul>-backend='Finch'-side=1000] 750.1 µs 958.8 µs -21.76%
test_elemwise[f=<built-in function mul>-backend='Finch'-side=100] 706.6 µs 908.3 µs -22.21%
test_elemwise[f=<built-in function mul>-backend='Finch'-side=500] 723.3 µs 935.9 µs -22.72%
hameerabbasi commented 1 month ago

I see that examples in examples/ directory aren't executed in the CI job anymore, is it intended? I think they should still be executed.

I believe that benchmarks should be moved to CodSpeed benchmarks, see #772, but examples with small datasets should be executed without measuring timings.

mtsokol commented 1 month ago

Ok, then I guess this PR is ready anyway.