[Mono-devel-list] Mono ASP.NET is very slow with big html pages...

Hubert FONGARNAND informatique.internet at fiducial.fr
Thu May 12 05:04:10 EDT 2005


I apologize, i've found my problem...
This slowdown is due to System.Drawing 

Let me explain...
Mono renders a page with more than 100 menu, for each menu, the largest item 
size is calculated by this function :

		  SizeF size;
                  float emSize = Convert.ToSingle(fontInfo.Size.Unit.Value);
                  emSize = (emSize==0 ?8 :emSize);   
                  Font stringFont = new Font(fontInfo.Name, emSize); 
                  Graphics g=new Bitmap(1,1);
                  size = g.MeasureString(text, stringFont);                  
		  g.Dispose();
                  return size;     

After doing some tests, i've seen that the slowest line is : 
                  Font stringFont = new Font(fontInfo.Name, emSize); 
So the creation of this Font object (the font is Arial) is extremely slow 
comparing to MS.NET...
If I remove this line, the page loads as fast as MS.NET (a little bit 
faster...)

Is there a way to optimize System.Drawing for this problem;
or is there a better way to measure a text string length (with variable font 
size) without using this very slow function...

Thanks in advance

Le Jeudi 12 Mai 2005 00:11, Gonzalo Paniagua Javier a écrit :
> On Wed, 2005-05-11 at 10:41 +0200, Hubert FONGARNAND wrote:
> > I'm currently working on an intranet project. We want to develop it as a
> > cross-platform project. It would be useful that it could run under MS.NET
> > or Mono...
> > I'm working with the svn version of mono 1.1.7.99
> > I've seen that mono (xsp) is very slow when rendering (relative) big html
> > rich content. My Accueil.aspx pages is about 315Ko... It contains many
> > javascript for generating menus dynamically.
> > On MS.NET, the page takes 3sec (the first time) to be rendered, and about
> > 500ms (the second time)
> > On Mono it takes about 12sec everytime. when rendering the xsp process
> > takes about 100% of my cpu :
> >
> > Is there a way to do some profiling in order to know wich method takes
> > the more time?
> > When I run mono --verbose xsp.exe I see that xsp is waiting most of
> > time... is it normal?
>
> You can use --profile or file a bug report in bugzilla including a test
> case and we'll do the profile.
>
> -Gonzalo
_______________________________________________
Ce message et les éventuels documents joints peuvent contenir des informations confidentielles.
Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'étant pas sécurisées, l'intégrité de ce message n'est pas assurée et la société émettrice ne peut être tenue pour responsable de son contenu.



More information about the Mono-devel-list mailing list