If adding some integer to a set, redis will store these integer with intset.
When i add a large integer to this set, intset would upgrade the intset's encoding to holding large integer automatically. The operation need more memory to holding whole integer data.
Now if i remove the largest integer, the intset is still used old large encoding, the intset is still used more memory to hoding whole integer data. The large encoding will result in wasted memory.
The integer data in intset is ordered.
So when removing data from intset, why not check the first and last value to using little encoding? It would save some memory.