weightedrandom
A Go library for efficient weighted random picking (by minaguib)
rand
Fast, high quality alternative to math/rand and golang.org/x/exp/rand (by flyingmutant)
weightedrandom | rand | |
---|---|---|
1 | 3 | |
9 | 233 | |
- | - | |
0.0 | 2.0 | |
about 2 years ago | 10 months ago | |
Go | Go | |
MIT License | Mozilla Public License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
weightedrandom
Posts with mentions or reviews of weightedrandom.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-03-20.
-
Fastest way to pick uniformly from a slice from multiple goroutines
If you ever need random picking with weights, consider the weightedrandom package I authored.
rand
Posts with mentions or reviews of rand.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-03-11.
-
We have getrandom at home
This may very well be a bit offtopic in the rust subreddit, but in case you need fast high quality non-crypto PRNG in Go, I've made one that I believe to be decent. It is unfortunate that math/rand is unlikely to significantly improve due to the backward compatibity and can't be recommended for anything non-trivial.
-
Alternative to math/rand and golang.org/x/exp/rand
I got a bit stuck trying to find a set of good permutation functions for all required bit widths; I've created an issue to collect information in one place.
What are some alternatives?
When comparing weightedrandom and rand you can also consider the following projects:
faker - Random fake data and struct generator for Go.
youtube-stalker-bot - A telegram bot that sends you a random video
cargo-xtask