Production algorithm tricks anyone?
For solving the problem of proportioned distribution of ads into sites at internet-scale, we had used a random number generator within a segmented number range. It was elegant and distributed synchronization and such complexities.
Any more of such elegant tricks in production software?
19 comments
[ 3.3 ms ] story [ 54.0 ms ] threadhttps://en.wikipedia.org/wiki/B-tree
https://en.wikipedia.org/wiki/Hash_table
https://en.wikipedia.org/wiki/Paxos_(computer_science)
http://www.drdobbs.com/cpp/misusing-floating-point-arithmeti...
http://www.drdobbs.com/cpp/some-programs-are-poorly-designed...
Could you describe your current implementation and its elegance?
generate a random number between 0:100 if the number is 0-30 the Ad 1 has to be shown if the number is 30-70 the Ad 1 has to be shown else RTB is to be called
The servers can be now independent and no need to share the state, or have a lock based counter. For large number of requests, and with a good random number generator, you will get good results.
Pretty standard in what context? Can you elaborate? Is there a name for the algorithm?
What is RTB?
One that comes to mind is XOR-swap. It's cute, but it's likely slower than using a temp var.
Some of the integer population count algos (1's counting) are clever.
Also, original Doom source has some neat tricks.
Very cool algorithm used in (among other things) redis.