Rich Internet for Everyone (RICHIE) Network: United XAML - XUL Alliance - XUL News - XUL Forum - The Richmond Post - RichCon 2005
The Richmond Post Logo
Chronicle of the Xul Revolution
« Motlib - .Nyet XUL Motor for Windows Forms in C# - .Net GUI Bliss | Main | Inside the Crystal Ball: Industry Analyst Predict The Comeback of Rich Clients and the Coming of Richer/Better Browsers »
Lines of Code Benchmark: MFC vs. Windows Forms vs. XUL
posted by Gerald Bauer on November 18, 2002

How does XUL compare with Microsoft Foundation Classes (MFC) or Windows Forms? Check out the three "Hello World" contestants and see yourself.

MFC Contestant

// HelloMFC.H

class CSimpleApp : public CWinApp
    virtual BOOL InitInstance()
      m_pMainWnd = new CSimpleFrame;  
      m_pMainWnd->ShowWindow( m_nCmdShow );
      return TRUE; 

class CSimpleFrame:public CFrameWnd
      Create( NULL, "Hello MFC" );
    afx_msg void OnPaint();
// HelloMFC.CPP

CSimpleApp helloApp;

BEGIN_MESSAGE_MAP( CSimpleFrame, CFrameWnd )

void CSimpleFrame::OnPaint()
  CPaintDC dc( this );
  dc.TextOut( 200, 200, "Hello World from MFC" );

Windows Forms Contestant

using System;
using System.Windows.Forms;

public class SimpleForm : Form 
  private Label label1;

  public SimpleForm() 
    label1 = new Label();
    label1.Text = "Hello World from Windows Forms";
    Controls.Add( label1 );
  static void Main() {
    Application.Run(new SimpleForm());	

XUL Contestant

  <label value="Hello World from XUL" />

And the winner is... Do I need to comment?


You are joking, i supposed to see real world benchmark. What about application like SwingSet2?

Posted by: dmi at August 15, 2003 06:32 AM

That is very funny.
What a character!

But this really is a serious issue. Everything that programmers are writing now is getting slower and slower.
Sure we have hardware that is getting faster and faster to make up for the software that crawls at a snail's pace.

There's not doubt that C# is beautiful compared to MFC, and with DotGNU, it will soon be cross-platform as well.

And XUL is a wonderful idea, extending the ease of internationalization and GUI production in general.

But what is the cost here? Speed. I thought that with faster processors, I wouldn't have to wait 15 seconds for my browser to open. But Mozilla Firebird (which is a wonderful browser) takes quite a while to open, and C# apps are slow and clunky. And my machine is in the Ghz.

The faster hardware gets, the slower and clunkier the software gets. We'll never have fast apps, no matter how fast computers get.

Can this be for real? What a downer!

I'd like to see a real benchmark. Sure XUL beats the rest in terms of time for the programmer, but what about the users? Just the opposite!!!!


Posted by: Rich at December 4, 2003 07:35 PM
SourceForge Logo Please send comments on our web pages to our public xul-talk mailinglist or to a member of our web team. Copyright © 2003, 2004, 2005 Open XUL Alliance