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

2005-05-13 Thread Hubert FONGARNAND
Hello,
We've rewritten our programm without using any server side text-size 
calculation...
I just use the client browser, (a table without any fixed width can adapt his 
size automatically)
Now, my pages loads as fast as MS.NET
But, the problem isn't here 
System.Drawing font measure function is incredibly slower and CPU intensive 
than MS.NET... I can do benchmarks if you want... (i've gentoo linux and 
WS2003 on the same machine)

Le Jeudi 12 Mai 2005 19:50, Rafael Teixeira a écrit :
 Also, you can create that font only once (cache it by the Name and
 Size) and reuse in many pages, just beware o memory consumption, if
 you doesn't limit the choices for fonts and sizes.

 I also reiterate what Ben said, doesn't calculate things on the
 server, because things will go diferently on the client. To add
 another issue (besides user-chosen-css, installed fonts) the
 resolution may be different, what makes the same font render quite
 differently.

 HIH,

 On 5/12/05, Ben Maurer [EMAIL PROTECTED] wrote:
  On Thu, 2005-05-12 at 11:04 +0200, Hubert FONGARNAND wrote:
   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...
 
  I'm not sure how much we can speed that up. I can take a look at how
  Cairo does the stuff.
 
  However, if I understand what you are doing correctly, you are trying to
  measure a string on the server and see how large it will be on the
  client. I am not sure how well that will work. On the client side,
  people might have different fonts installed, or might even use a user
  css sheet. Nonetheless, we should still try to be faster here.
 
  -- Ben
 
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
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.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


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

2005-05-12 Thread Hubert FONGARNAND
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.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


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

2005-05-12 Thread Ben Maurer
On Thu, 2005-05-12 at 11:04 +0200, Hubert FONGARNAND wrote:
 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...

I'm not sure how much we can speed that up. I can take a look at how
Cairo does the stuff.

However, if I understand what you are doing correctly, you are trying to
measure a string on the server and see how large it will be on the
client. I am not sure how well that will work. On the client side,
people might have different fonts installed, or might even use a user
css sheet. Nonetheless, we should still try to be faster here.

-- Ben

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


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

2005-05-11 Thread Rafael Teixeira
First of all,

Separate your Javascript on a .js file that you include, and generate
your menus from embedded or on-demand xml data. 315KB for a page is
surely not a good design.

:)

On 5/11/05, Hubert FONGARNAND [EMAIL PROTECTED] 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?
 
 Thanks in advance...
 ___
 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.
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 


-- 
Rafael Monoman Teixeira
---
I'm trying to become a Rosh Gadol before my own eyes. 
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.
It hurts!
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


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

2005-05-11 Thread Gonzalo Paniagua Javier
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


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list