Click here to Skip to main content
15,868,419 members
Articles / Desktop Programming / WPF

Benchmark start-up and system performance for .Net, Mono, Java, C++ and their respective UI

Rate me:
Please Sign up or sign in to vote.
4.94/5 (44 votes)
2 Sep 2010CPOL19 min read 158.9K   1.3K   67  
What is the start-up and system performance overhead for .Net, Mono, Java versus C++ and Forms, WPF, Swing versus MFC
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace Mono26Perf
{
    class Program
    {

         
        private const long TicksPerMiliSecond = TimeSpan.TicksPerSecond / 1000;
        static int Main(string[] args)
        {
            DateTime mainEntryTime = DateTime.UtcNow;//100 nanoseconds units since 1601/1/1
            int result = 0;

            if (args.Length > 0)
            {
                DateTime launchTime = System.DateTime.FromFileTimeUtc(long.Parse(args[0]));
                long diff = (mainEntryTime.Ticks - launchTime.Ticks) / TicksPerMiliSecond;
                result = (int)diff;

            }
            else
            {
                System.GC.Collect(2, GCCollectionMode.Forced);
                System.GC.WaitForPendingFinalizers();
/*
                result = (int)(System.Environment.WorkingSet);//return in KB

                //result = (int)(System.Environment.WorkingSet/1024);//return in KB
#if DEBUG
                Console.WriteLine("runtime version is {0}, self reporting Working set = {1:x8} KB",Environment.Version,result);
#endif
 */
                System.Threading.Thread.Sleep(5000);
            }

            return result;
        }
    }
  
  
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Decebal Mihailescu is a software engineer with interest in .Net, C# and C++.

Comments and Discussions