Results 1 to 12 of 12

Thread: Just Got C#

  1. #1

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394

    Just Got C#

    Hi There!

    I just downloaded .NET SDK and the free C# IDE and I have a problem with it - it is too slow. The IDE takes forever to load and takes forever to do stuff, especially painting windows.

    Is there a way to speed all this up?

    And By the Way, is Java and C# the same speed? The C# example apps and C# IDE take ages to load just like Java.

    Thaks for any help.
    VS.NET 2003

    Need to email me?

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    What are your system specs? The free IDE loads at a decent speed on my Win2000, P3 500mhz, 256 mb ram system. If you have WinXP, that might be the culprit.
    Dont gain the world and lose your soul

  3. #3
    Hyperactive Member kleptos's Avatar
    Join Date
    Aug 2001
    Location
    The Dark Carnival
    Posts
    346
    What free C# IDE?
    ..::[kleptos]::..
    • Database Administrator (MSSQL 2000)
    • Application Developer (C#)
    • Web Developer (ASP.NET)


  4. #4
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    SharpDevelop
    Dont gain the world and lose your soul

  5. #5
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    sharpdevelop is pretty fast for loading
    for my machine anways
    (AMD 2200+, 512 DDR)

  6. #6

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394
    Runs awful

    533 Mhz and 128 Mb Ram

    OS: Windows 2000 Advanced Server
    VS.NET 2003

    Need to email me?

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    And By the Way, is Java and C# the same speed? The C# example apps and C# IDE take ages to load just like Java.
    The first time you run a C# app, or any .Net app, the code is compiled by the Just In Time compiler (JIT). You will notice a slow start because of this. Try running the app a second time, not from the IDE, but by clicking the EXE and see if it loads faster. This is because you are now using the binary instead of the MSIL, which has to be compiled by the JIT at first.

  8. #8

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394
    Thanks for the suggestion, that does work but I decided to benchmark C# against C++ and see what I have.

    C#:
    Code:
    public static void Main(string[] args)
    {
    int ticks = System.Environment.TickCount;
    
    int v = 0;
    		
    for(int i = 0; i < 2120000000; i++)
    	v++;
    		
    	ticks = System.Environment.TickCount - ticks;
    		
    	Console.WriteLine("Time Took: ");
    	Console.Write(ticks);
    	Console.WriteLine("\nItems: ");
    	Console.Write(v);
    		
    }
    C++
    Code:
    int main(int argc, char* argv[])
    {
    	unsigned long i = 0;
    	DWORD T = GetTickCount();
    
    	for (unsigned long var = 0; var < 2120000000; var++)
    		i++;
    
    	T = GetTickCount() - T;
    
    			
    	printf("Time Took: %d\nItems: %ld", T, i);
    	return 0;
    }
    Results:

    C++: 0 ticks
    C#: 8862 ticks

    This results are a bit weird - but they seem true to me. So, C# is unsuitable for commercial development for slower computers. Good langauge though.

    NOTE: I did optimize C++ exe but I can't find optimizations for C# in my compiler - so this probably has something to do with this.
    Last edited by made_of_asp; Nov 29th, 2002 at 02:55 AM.
    VS.NET 2003

    Need to email me?

  9. #9
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Just to be fair, create the integer variable outside of where you start counting the ticks like you did in the C++ example.
    Code:
    public static void Main(string[] args)
    {
    int v = 0;
    
    int ticks = System.Environment.TickCount;
    		
    for(int i = 0; i < 2120000000; i++)
    	v++;
    		
    	ticks = System.Environment.TickCount - ticks;
    		
    	Console.WriteLine("Time Took: ");
    	Console.Write(ticks);
    	Console.WriteLine("\nItems: ");
    	Console.Write(v);
    		
    }
    Still though, even with that modified, it can't compair to C++ as far as speed. It was never meant to. You can get a little speed back in C# if you wanted to use unmanaged code and pointers. You could probably come pretty close to closing that speed gap. But if you do that, why are you using C#?

    Anyway, the strength of C# comes from the speed of your development. You can create a windows application in C# a hell of a lot faster than you could if you use C++, even using the MFC's. It comes down to this: Both languages have their roles in application development. Use the right tool for the job at hand. I am not going to use a hammer to take a screw out, and I am not using a screwdriver to nail in a nail.

  10. #10

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394
    Yes, I know C# is a RAD tool just like Visual Basic. I have a question though: are future commercial applications going to be developed in C++ or C#( I mean true applications, not database interfaces)?

    You cant use int in C++ in that example because unsigned int only goes to around 65000.

    Thanks for your help. I see that I'l need to learn C# sooner or later.
    VS.NET 2003

    Need to email me?

  11. #11
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    C# can be used for commercial apps. The VS.NET ide was written in C#. Also take a look at the ASP.NET web matrix, that was written in C# and considering the time it took, to write, I'd say its a very good app.
    Dont gain the world and lose your soul

  12. #12
    Hyperactive Member kleptos's Avatar
    Join Date
    Aug 2001
    Location
    The Dark Carnival
    Posts
    346
    If i might add, even though i use VS.NET, Web Matrix is a great application. I told a few friends about it and now thats all they use. So there are plenty of uses in a commercial world for C#, plus its not even a year old yet, so not everyone has decided to revamp their software yet. Personally, i love C#...
    ..::[kleptos]::..
    • Database Administrator (MSSQL 2000)
    • Application Developer (C#)
    • Web Developer (ASP.NET)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width