[vlc-devel] [RFC] Directory access: use a decent insertion?order
Antoine Cellerier
dionoea at videolan.org
Sun Feb 14 19:06:00 CET 2010
On Sun, Feb 14, 2010, Rémi Denis-Courmont wrote:
> > Sorting of the directory nodes wouldn't add any significant overhead (it
> > could even be coded to reduce the numper of asprintf psz_xspf_extension
> > string concatenations and thus probably reduce the total runtime).
> > Sorting of the items would probably be possible fairly easily too. All
> > you need to sort is the <extension> tree structure bit. I'll code a
> > small prototype tomorrow.
>
> The problem is not sorting. The CPU is fast.
>
> You need to keep the full list of files in every directory that you recurse
> through, which takes a lot more memory than at the moment.
>
> But what I'm most afraid is the I/O. Currently, one Block() call = one
> readdir() call, so the I/O latency is as short as possible. To sort a
> directory, you need to read it all, and then sort it and then output. And that
> will have much much longer latency for large directories.
I'm sure that it's possible without adding any readdir() calls. Just a
small memory usage increase (and a lot less asprintf calls unless I'm
mistaken, we alrady store the full tree structure xml string description
anyway). I'll give it a try tonight just to see what it would exactly
imply and post it here for feedback.
--
Antoine Cellerier
dionoea
More information about the vlc-devel
mailing list