in reply to Re: Re: Sorting according to date in thread Sorting according to date
I like your solution, it is elegant but a bit slower. Conversion
of date strings to integers is expensive, but it pays off
in the sorting faze. Dates that are close together have
4 to 6 equal characters from the beginning of the string,
and the for loop is also faster than map. I made a couple
of benchmarks to verify that. The difference in speed is not
significant.
I had to assume some date format to be able to produce working
solution. It is easy to modify for different format.
|