Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Help > Broken sorting in Explorer

Reply
Thread Tools Display Modes

Broken sorting in Explorer

 
 
ClassCastException
Guest
Posts: n/a

 
      09-15-2010
So I go to sort a directory of roughly 4000 photos by date taken. The
column headings change appropriately right away, showing a down arrow in
the date taken column, but the visible files remain sorted by name and
instead of them re-sorting immediately a progress bar starts crawling at
the top.

Here's the buggy behavior: when the progress bar got past about 80% it
began to slow down rapidly. By the time it was into the box with the red
X it was barely moving; less than 1/20 the speed it had had for most of
the time.

The sort completed eventually, but it took a lot longer than it should
have.

What happened? Getting all the date takens out of the exif blocks in the
files should have been somewhat slow, but not that slow and linear in the
number of files. Actually sorting on that data should have been n log n
but also lightning fast compared to getting the data (sorting 4000
pointers by a few integers a few indirections away from the pointers
should take milliseconds on modern hardware with a decent C or C++
quicksort implementation).

The only thing I can see causing it to make rapid progress on the task at
first but then slow down is if it used an algorithm that was quadratic
and back-loaded most of the work.

The obvious inference is that the idiots at Microsoft used bubble sort
and specifically implemented it to swap 0, 1 if needed; then 0,1 and then
1,2 if needed; then 0,1 and 1,2 and 2,3 if needed; etc.; and the progress
meter ticks for each iteration of the outermost loop. Then the speed of
the meter would drop inverse-linearly over time. That doesn't *quite*
match what I observed, where the speed seemed to drop fastest at the end
instead of at the start, but it would cause both a very slow sort and a
slowing progress meter, so it beats any other hypothesis that seems
reasonable at this point...
 
Reply With Quote
 
 
 
 
ClassCastException
Guest
Posts: n/a

 
      09-15-2010
On Wed, 15 Sep 2010 02:50:19 +0000, ClassCastException wrote:

> So I go to sort a directory of roughly 4000 photos by date taken. The
> column headings change appropriately right away, showing a down arrow in
> the date taken column, but the visible files remain sorted by name and
> instead of them re-sorting immediately a progress bar starts crawling at
> the top.
>
> Here's the buggy behavior: when the progress bar got past about 80% it
> began to slow down rapidly. By the time it was into the box with the red
> X it was barely moving; less than 1/20 the speed it had had for most of
> the time.
>
> The sort completed eventually, but it took a lot longer than it should
> have.
>
> What happened? Getting all the date takens out of the exif blocks in the
> files should have been somewhat slow, but not that slow and linear in
> the number of files. Actually sorting on that data should have been n
> log n but also lightning fast compared to getting the data (sorting 4000
> pointers by a few integers a few indirections away from the pointers
> should take milliseconds on modern hardware with a decent C or C++
> quicksort implementation).
>
> The only thing I can see causing it to make rapid progress on the task
> at first but then slow down is if it used an algorithm that was
> quadratic and back-loaded most of the work.
>
> The obvious inference is that the idiots at Microsoft used bubble sort
> and specifically implemented it to swap 0, 1 if needed; then 0,1 and
> then 1,2 if needed; then 0,1 and 1,2 and 2,3 if needed; etc.; and the
> progress meter ticks for each iteration of the outermost loop. Then the
> speed of the meter would drop inverse-linearly over time. That doesn't
> *quite* match what I observed, where the speed seemed to drop fastest at
> the end instead of at the start, but it would cause both a very slow
> sort and a slowing progress meter, so it beats any other hypothesis that
> seems reasonable at this point...


I just had a really horrible thought. Maybe they didn't preload all the
date-takens. Maybe it goes to the disk EVERY TIME THE SORT DOES A
COMPARE. So the sort is slowed even more, and worse, the later iterations
go over nearly the whole directory, killing disk cache performance and
causing the particularly precipitous speed drop near the end (when the
total size of the jpeg file headers read in one iteration crosses over
the cache size).

ARGH! A first-year comp sci graduate could easily have done better.
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I also have an error 646 in Windows update. Please help. Jose Windows Update 12 01-09-2010 01:00 PM
Re: How To Get FTP Shortcut to Open Windows Explorer NOT Internet Explorer PA Bear [MS MVP] Internet Explorer 0 12-04-2009 05:59 AM
IE7 forcing itself on me? Adela Internet Explorer 5 10-24-2009 01:10 PM
What on earth did you do to windows explorer? IanInLangley Windows Vista File Management 18 06-14-2008 07:51 PM
Explorer Lost the Ability to Move or Copy Files Raivo Windows Vista File Management 10 04-01-2007 11:46 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59