Artem Tarasov:

Use a container adequate for the task at hand, e.g. red-black tree.

If you have a limited number of small values (like 30 ints) using a sorted array is quite efficient, and keeps low the binary size and the pressure on the code L1 cache :-)

Arrays are awesome on modern CPUs.

Bye,
bearophile

Reply via email to