I confirm what you observed, and that corresponds to what you already told me some time ago.
After your comment I change my code and I am now using a combination of select rank
and pack
. Which may not be suitable when performance is critical but does the job for me.