[Mono-dev] Fixes for System.Net.Mail

Paolo Molaro lupus at ximian.com
Tue Dec 5 14:50:43 EST 2006


On 12/04/06 Miguel de Icaza wrote:
> If we are going down the path of mapping file names to mime types, we
> should instead use a switch statement that will consume no memory for
> the large majority of applications, something similar to what tokenizers

Well, no memory except the interned strings and the big jitted code that
results.

> > Or should we add an icall so we implement this stuff using the operating
> > system API or a C implementation? What is quite clear to me is that we
> > should not use an hashtable with all the entries which is kept in memory
> > all the time.
> 
> This is highly operating system *and* desktop specific, and it is
> usually a slow process.
> 
> We would need to determine if we want a mime-type based on the filename,
> or a mime-type based on the actual contents of the file.   The latter is
> more correct, but has some undesirable effects like touching the file
> system (which could in some cases take forever, or block the
> application, for example over /afs and other file systems) and also
> might slow down applications a lot.
> 
> If we are going for mime-type-based-on-filename-only, then I would use a
> switch statement instead of the Hashtable.

Having an icall is 10 times more efficient in this case, even if we
don't use the operating system API (or files, like the SWF code does
already).

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list