[Maf] bugs and questions :-)
Christopher Ottley
xknight at users.sourceforge.net
Sat Feb 19 00:15:51 EST 2005
Molle Bestefich wrote:
> 1. When MAF is installed, Mozilla correctly opens MHTML files named
> "xxx.mht". Files named ".mhtml" does not open however, one has to open
> IE or MS-WORD (or rename the file, if you know what's wrong..)
>
>
.mht was the default extension I encountered when I was doing design and
testing for the MHTML related part of MAF. I could add handling for the
.mhtml extension but, at present, I have larger bugs and feature
requests planned to implement. Just so I don't forget, please file a bug
report in bugzilla on mozdev if you really want this.
> 2. When loading an archive in one browser window, all other windows
> are frozen.
>
>
The decoding is done in Javascript, and although fast, can take a bit of
time to do. Technically they're not frozen, just really slow. (Slow
enough to look frozen). The engine is shared amongst all the windows, so
if it's taken up decoding it has little time to draw / repaint.
> 3. The correct name for these files is "MHTML Document", not "MHT
> Archive" - check 'File Types' under 'Folder Options' in Windows.
>
>
Pot-aye-toe pot-ah-toe. Heh.
> 4. Loading MHTML archives is quite slow.. Why? Could it be profiled
> and optimized?
>
>
The algorithm to do most of the decoding is O(n). To meet the MHT
standard for decoding however I had to implement a O(3n*m) algorithm. I
benchmarked it and that's the thing that takes most of the processing
time. I had originally started with a much more efficient algorithm for
that in mind, but Mozilla security components stopped me in my tracks at
the time. As a quick workaround for 0.5.0, MAF MHTs don't actually need
the algorithm because MAF doesn't encode using CIDs or nested mime
parts, and so in CVS I have a check that skips running the algorithm if
it's a MAF MHT archive. The effect is that the decoding is faster if
it's a MAF MHT, but the same speed if it's not.
I also looked into using native libraries for the encoding and decoding.
I have a C++ linux library that speeds up MHT encoding a bit, but not as
much as I had hoped, so I kept it out of CVS. That and cross compiling
to get a DLL was giving me beans. :) .
> 5. Why the new archive format? What advantages does it provide over
> MHTML or .mhtml.gz?
>
>
Well, first off it's a true archive, so you can easily modify it outside
of Mozilla. Another advantage is that you can easily place multiple
pages in the archive. MHTML is technically an encoding that transforms
binary and text files to encoded text so .mhtml.gz would first have to
decompress and then decode the document to view it. With .maff all you
have to do is decompress. Simpler usually means faster and faster is
usually better. :) .
Regards,
Christopher.
More information about the Maf
mailing list