Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

georani

@georani
About
Posts
40
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • .NET 6.0 is Slower than .NET Framework In Some String Operations
    G georani

    Randor wrote:

    Can you run the String.IndexOf benchmark again using StringComparison.Ordinal and post the result?

    Thanks, it is the solution: Now .NET 6.0 is 2X times FASTER than .NET Framework 4.8

    Starting tests for .NET Framework 3.5, wait...
    Elapsed Time for [String.Replace]: 51,0830947 sec
    Elapsed Time for [String.IndexOf]: 0,5451713 sec
    Elapsed Time for [String.Contains]: 0,5424978 sec
    Elapsed Time for [String.SubString]: 17,7345287 sec
    Elapsed Time for [String.Remove]: 15,021131 sec

    Elapsed Time for [.NET 3.5]: 84,9272387 sec

    Starting tests for .NET Framework 4.8, wait...
    Elapsed Time for [String.Replace]: 53,2363039 sec
    Elapsed Time for [String.IndexOf]: 0,5760411 sec
    Elapsed Time for [String.Contains]: 0,595356 sec
    Elapsed Time for [String.SubString]: 14,8117435 sec
    Elapsed Time for [String.Remove]: 11,2053769 sec

    Elapsed Time for [.NET 4.8]: 80,4258634 sec

    Starting tests for .NET 6.0, wait...
    Elapsed Time for [String.Replace]: 18,5094685 sec
    Elapsed Time for [String.IndexOf]: 0,3495122 sec
    Elapsed Time for [String.Contains]: 0,32621 sec
    Elapsed Time for [String.SubString]: 12,1062252 sec
    Elapsed Time for [String.Remove]: 10,1427749 sec

    Elapsed Time for [.NET 6.0]: 41,4367067 sec

    The Lounge csharp dotnet com performance announcement

  • .NET 6.0 is Slower than .NET Framework In Some String Operations
    G georani

    Eddy Vluggen wrote:

    Note the #1 in all tests.

    Thank you. I will test it it. And C Language seems to be a great choice. Or Golang. Or Rust.

    The Lounge csharp dotnet com performance announcement

  • .NET 6.0 is Slower than .NET Framework In Some String Operations
    G georani

    Gerry Schmitz wrote:

    comparing StringBuilder

    There is no IndexOf function in StringBuilder. See: .net - Why doesn't StringBuilder have IndexOf method? - Stack Overflow[^]

    The Lounge csharp dotnet com performance announcement

  • .NET 6.0 is Slower than .NET Framework In Some String Operations
    G georani

    PIEBALDconsult wrote:

    Yes, so how long does it take?

    Computer: Intel Core I5 .NET 6.0:

    Elapsed Time for [String.Replace]: 17.1540338 sec
    Elapsed Time for [String.IndexOf]: 32.473905 sec
    Elapsed Time for [String.SubString]: 11.9497695 sec
    Elapsed Time for [String.Remove]: 9.2207969 sec

    .NET 4.8

    Elapsed Time for [String.Replace]: 47.532167 sec
    Elapsed Time for [String.IndexOf]: 2.3447133 sec
    Elapsed Time for [String.SubString]: 12.1748157 sec
    Elapsed Time for [String.Remove]: 11.4768551 sec

    The Lounge csharp dotnet com performance announcement

  • .NET 6.0 is Slower than .NET Framework In Some String Operations
    G georani

    Pete O'Hanlon wrote:

    It's advisable to use a real benchmarking framework

    Not in this case, StopWatch is sufficient.

    The Lounge csharp dotnet com performance announcement

  • .NET 6.0 is Slower than .NET Framework In Some String Operations
    G georani

    pkfox wrote:

    Does it really matter in real world applications ?

    Yes, my application become unusable after porting it to .NET 6, it uses a lot of string.IndexOf functions.

    The Lounge csharp dotnet com performance announcement

  • .NET 6.0 is Slower than .NET Framework In Some String Operations
    G georani

    Some tests to check some functions not tested in link below: Performance Improvements in .NET 6 - .NET Blog (arrays-strings-spans) .NET 6.0 is (comparing its performance to .NET Framework 4.8): • 3x faster on String.Replace operations • 16x slower on String.IndexOf operations, • 1.4x faster on String.Substring operations • The same on String.Remove operations Copy paste the code below and compile with .NET 6.0 and .NET Framework 4.8 and see by yourself.

    //Simple Benchmark test for working with Strings in different versions of .NET Framework

    string test = "Lorem Ipsum is simply dummy text" +
    " of the printing and typesetting industry. " +
    "Lorem Ipsum has been the industry's " +
    "standard dummy text ever since the 1500s, " +
    "when an unknown printer took a galley " +
    "of type and scrambled it to make a type specimen book. " +
    "It has survived not only " +
    "five centuries, but also the leap into electronic typesetting," +
    " remaining essentially unchanged." +
    " It was popularised in the 1960s with the release" +
    " of Letraset sheets containing Lorem Ipsum passages," +
    " and more recently with desktop publishing software like " +
    "Aldus PageMaker including versions of Lorem Ipsum.";

    System.Diagnostics.Stopwatch K = new System.Diagnostics.Stopwatch();

    K.Reset(); K.Start();
    for (var v = 1; v <= 10000000; v++)
    {
    test = test.Replace("a", "bla bla bla bla");
    test = test.Replace("bla bla bla bla", "a");
    }
    K.Stop();
    System.Console.WriteLine($"Elapsed Time for [String.Replace]: {K.Elapsed.TotalSeconds} sec");

    K.Reset(); K.Start();
    for (var v = 1; v <= 1000000; v++)
    {
    int i = test.IndexOf("including versions of Lorem Ipsum");
    }
    K.Stop();
    System.Console.WriteLine($"Elapsed Time for [String.IndexOf]: {K.Elapsed.TotalSeconds} sec");

    K.Reset(); K.Start();
    for (var v = 1; v <= 600000000; v++)
    {
    var s = test.Substring(25, 50);
    }
    K.Stop();
    System.Console.WriteLine($"Elapsed Time for [String.SubString]: {K.Elapsed.TotalSeconds} sec");

    K.Reset(); K.Start();
    for (var v = 1; v <= 90000000; v++)
    {
    var s = test.Remove(45, 60);
    }
    K.Stop();
    System.Console.WriteLine($"Elapsed Time for [String.Remove]: {K.Elapsed.TotalSeconds} sec");

    System.Console.WriteLine("Press a key to exit...");
    System.Console.ReadKey();

    The Lounge csharp dotnet com performance announcement

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Matt McGuire wrote:

    there is nothing wrong with VB.net. It's a good language; it has it's strengths and weaknesses, just like C# does. They are not exactly equal in all situations, but close. When to choose one over the other, is mostly a personal preference. ... for all the VB.net haters out there, I've been in development now for 20+ years, I've seen a lot and learned a lot, and frankly language wars are stupid; just use the language that is correct for the situation and let others be.

    Wow!! Thank you Some words of wisdom here finally

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Mark Miller wrote:

    Very few are listening.

    Sincerely, -Mark

    OK, anyway you are breaking this site rules beeing so impolite, this an evidence of possible disguise of lack of knowledge about what you are saying.

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Mark Miller wrote:

    Sorry, but YES YOU CAN, if you know even 1% of C# BASIC syntax

    This C# code you made is valid only in Visual Studio 2017 and C# 7.0, few people know that But the equivalent VB.net is so since 2002 So you have made a stupid and impolite declaration about my C# knowledge Pattern Matching in C# 7.0 Case Blocks -- Visual Studio Magazine[^]

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Dave Kreskowiak wrote:

    Visual Basic is the odd man out in the new .Net | InfoWorld[^] The .NET Language Strategy | .NET Blog[^]

    These 2 articles you cited are almost 2 years old (February 1, 2017) . Now (2018) the reality is another, click to see: .NET Core 3 and Support for Windows Desktop Applications | .NET Blog[^]

    Article excerpt:

    C#, F# and VB already work with .NET Core 2.0. You will be able to build desktop applications with any of those three languages with .NET Core 3.

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Eddy Vluggen wrote:

    Saying that VB.NET s a C# equivalent is nonsense;

    Really? So, please see this, click: VB.NET and C# Comparison (2016)[^]

    Eddy Vluggen wrote:

    I could offer help, but I'm weirdly enough not in a helpfull mood

    Is your bad mood because you got caught up in a lie?

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Kornfeld Eliyahu Peter wrote:

    I would say that such highly hypothetical code has nothing to do with nothing...

    Yes, it is an highly hypothetical and compilable code and randomly typed in Visual Studio. I did it just to show my point.

    Kornfeld Eliyahu Peter wrote:

    (L1 = (L1 == 42 || (L1 > 390)) ? L1 = 0 : (L1 == 70) ? L1 = 32 : L1;)

    This C# code you made is not similar to that one, I have edit it and added only one line inside "for" block:

    //C# code added
    DoSomethingWithL(x,y,z,L);

    Please, try again with this new code.

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Please, see this hypothetical and valid VB.NET code:

    'VB.NET code
    Select Case L1
    Case Is < 50
    If L1 = 42 Then

                    For x = 0 To 100
                        For y = 0 To 100
                            For z = 0 To 100
                                L1 = DoSomethingWithL(x,y,z,L)
                                If L1 = 2 Then L1 += 1 Else L1 = 0                             
                            Next z
                        Next y
                    Next x
                End If
    
            Case Is > 390
                L1 = 0
            Case Is = 70
                L1 = 32
    

    End Select

    Now compare with the only way to do the same thing in C#:

    // C# code with "Curly Braces Hell"

    if (L1 < 50)
    {
    	if (L1 == 42)
    	{
    
    		for (var x = 0; x <= 100; x++)
    		{
    			for (var y = 0; y <= 100; y++)
    			{
    				for (var z = 0; z <= 100; z++)
    				{
                        L1 = DoSomethingWithL(x,y,z,L);
    					if (L1 == 2)
    					{
    						L1 += 1;
    					}
    					else
    					{
    						L1 = 0;
    					}  
    				}
    			}
    		}
    	}
    }
    
    else if (L1 > 390)
    {
    	L1 = 0;
    }
    
    else if (L1 == 70)
    {
    	L1 = 32;
    }
    

    Which is more readable and fun? Do you prefer "Curly Braces Hell"?

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Dave Kreskowiak wrote:

    They are equivalent in the sense that they both target the .NET Framework.

    Not only this, They are equivalent in the sense that they both can do the same things with equivalent (almost) amount of code (amount of lines).

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Eddy Vluggen wrote:

    started as hobbyists used VB; a language that encourages bad constructs and minimizes the stuff the user has to know.

    It is a lie, You're confounding Classic VB (1998, 20 years old language) with VB.NET (an C# equivalent language). See by yourself: VB.NET and C# Comparison (2016)[^]

    Eddy Vluggen wrote:

    Google it yourself, it is not like it is a secret.

    I did it, I have found not articles about 50% of VB.NET projects fails, again you are lying.

    Eddy Vluggen wrote:

    Make it serious, or don't attempt another one.

    Done.

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Sander Rossel wrote:

    but I don't even think .NET Core supports VB.

    Please see it: .NET Core 2.1 downloads for Linux, macOS, and Windows[^]

    Released 10/2/2018

    Release notes:
    
    Supports C# 7.3
    
    Supports F# 4.5
    
    **Supports Visual Basic 15.5**
    

    Sander Rossel wrote:

    Microsoft telling us VB is still supported, but not further developed.

    You are wrong, please see this: .NET Core 3 and Support for Windows Desktop Applications (Winforms and WPF) | .NET Blog[^]

    Article excerpt:

    C#, F# and VB already work with .NET Core 2.0. You will be able to build desktop applications with any of those three languages with .NET Core 3.

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Eddy Vluggen wrote:

    Of course it is popular; everyone can be a programmer with VB

    With C# too, with Python too (#4 position in Tiobe index) ... Everyone can be a programmer with (put your preferred language here). Bad argument.

    Eddy Vluggen wrote:

    In other news, over 50% of projects fail.

    Source?

    Eddy Vluggen wrote:

    Your move :cool:

    Done.

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Minion no. 5 wrote:

    Popular with non-programmers.

    C# language is at the #6 position in that index, Java #1, Python #4... they are not programmers? Tiobe Index is the most popular comparator of programming languages on the internet, it is cited by thousands of magazines and articles in many years.

    The Lounge csharp javascript swift html

  • (Again) Visual Basic.NET Exceeded C# Popularity in TIOBE in October 2018 And it is Raising
    G georani

    Kornfeld Eliyahu Peter wrote:

    ...you will understand how VB is limited...

    You assertion is a lie. C# and VB.NET are equivalent languages!! See: VB.NET and C# Comparison (2016)[^]
    Sorry to use large fonts, but I guess you did not read it the first time :-D

    The Lounge csharp javascript swift html
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups