in reply to Re^2: Refactor my sort
in thread Refactor my sort
My take on it is this: the comparison operator on a string is a bit slow since it has to take locale and such into account. The GRT basically packs the data into a string of bytes such that a simple numeric comparison would reliably sort the data.
This saves you time because rather than go through the locale-conversion code to order the strings each time they're accessed, you perform the conversion once (during pack), then you just treat the keys as integers X bytes long, which are much simpler to compare.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Refactor my sort
by johngg (Canon) on Dec 22, 2006 at 23:10 UTC |