Re-2: [U-Boot-Users] Re: jffs2

kai-uwe.bloem at auerswald.de kai-uwe.bloem at auerswald.de
Thu Mar 6 10:24:39 CET 2003


Hi,

> > This sorting takes a rather long time. Actually, for about 3000+ fragments, 
> > an average of 600 loop runs per fragment :-(
>
> So my advice is to check how it's done in current MTD CVS and rewrite the
> jffs2 loader. 

It is *not* the crc calculation.

The original implementation just collected all fragements in a linked list.
This takes about 2 or 3 seconds for the 3000+ fragments, which is acceptable for me.

The sorting takes a much longer time. I didn't change the basic list implementation, hence sorted insertion requires list traversion to find the correct insertion point.
For my 3000+ fragments test, an average of about 600 elements where traversed, or about 2 millions (sic!) in total.

I reckon changing the implementation to linked lists of chunks of fragment pointers would improve this by magnitudes.
It is debatable if it's worth the implementation effort, though. The current behaviour is indeed incorrect, but it'll bite people only in extremely rare cases.

--kub


To: joakim.tjernlund at lumentis.se
    u-boot-users at lists.sourceforge.net





More information about the U-Boot mailing list