[Mono-devel-list] [PATCH] Avoid loading field metadata for enums

Ben Maurer bmaurer at ximian.com
Sat Feb 19 15:31:47 EST 2005


Hey guys,

This is a patch that avoids loading all the MonoClassField's, etc, for
enums. I took advantage of the fact that both csc and mcs put __value as
the first field in a class. This patch looks for that to be the first
member, and if it is, will use the type of the field to find the
underlying type.

It correctly falls back on the old code in the case that there is some
wacked out compiler that does not do this.

This patch gives a nice kickback on monodoc:

Before:
> [benm at omega benm]$ ps u -C mono
> USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
> benm     15237  0.0  1.9 34152 19968 pts/6   S+   14:36   0:00 mono /home/benm/install/lib/monodoc/browser.exe

After:
> [benm at omega benm]$ ps u -C mono
> USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
> benm     15243  0.0  1.9 34260 19740 pts/6   S+   14:36   0:00 /home/benm/msvn/mono/mono/mini/mono /home/benm/install/lib/monodoc/browser.exe

-- Ben




More information about the Mono-devel-list mailing list