MastodonC / kixi.stats

A library of statistical distribution sampling and transducing functions
https://cljdoc.xyz/d/kixi/stats
Eclipse Public License 1.0
355 stars 17 forks source link

Type hints #14

Closed sbelak closed 6 years ago

sbelak commented 6 years ago

At Metabase we're using kixi.stats quite extensively and started to run into performance issues. This PR fixes the low hanging fruit type hints and results in speedups between 50% and 1000%.

One potential issue: I cast everything to double. This could be considered a regression in the sense that none of the functions return a precise (long) result anymore. On the plus side, this also means things stop exploding with overflows on large inputs.

henrygarner commented 6 years ago

@sbelak it's great to hear you're getting value from kixi.stats!

On balance, the potential performance gains seem worth the trade-off. This is a good addition, many thanks.