Click here to Skip to main content
15,887,251 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralBD subtitle extraction Pin
trønderen3-Jun-22 12:28
trønderen3-Jun-22 12:28 
GeneralRe: BD subtitle extraction Pin
Randor 3-Jun-22 12:45
professional Randor 3-Jun-22 12:45 
GeneralRe: BD subtitle extraction Pin
trønderen4-Jun-22 3:20
trønderen4-Jun-22 3:20 
GeneralRe: BD subtitle extraction Pin
Randor 4-Jun-22 3:43
professional Randor 4-Jun-22 3:43 
GeneralRe: BD subtitle extraction Pin
trønderen4-Jun-22 7:11
trønderen4-Jun-22 7:11 
GeneralRe: BD subtitle extraction Pin
Jacquers3-Jun-22 20:02
Jacquers3-Jun-22 20:02 
GeneralRe: BD subtitle extraction Pin
trønderen4-Jun-22 3:40
trønderen4-Jun-22 3:40 
General.NET 6.0 is Slower than .NET Framework In Some String Operations Pin
georani3-Jun-22 5:52
georani3-Jun-22 5:52 
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.

C#
//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();

GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
PIEBALDconsult3-Jun-22 6:12
mvePIEBALDconsult3-Jun-22 6:12 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
0x01AA3-Jun-22 9:42
mve0x01AA3-Jun-22 9:42 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
PIEBALDconsult3-Jun-22 9:58
mvePIEBALDconsult3-Jun-22 9:58 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
georani3-Jun-22 11:50
georani3-Jun-22 11:50 
QuestionRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Randor 3-Jun-22 12:06
professional Randor 3-Jun-22 12:06 
AnswerRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
georani8-Jun-22 4:03
georani8-Jun-22 4:03 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Randor 10-Jun-22 6:13
professional Randor 10-Jun-22 6:13 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Pete O'Hanlon3-Jun-22 10:06
mvePete O'Hanlon3-Jun-22 10:06 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
georani3-Jun-22 11:38
georani3-Jun-22 11:38 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
JustDre6-Jun-22 6:31
JustDre6-Jun-22 6:31 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
pkfox3-Jun-22 11:02
professionalpkfox3-Jun-22 11:02 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
georani3-Jun-22 11:37
georani3-Jun-22 11:37 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
PIEBALDconsult3-Jun-22 12:29
mvePIEBALDconsult3-Jun-22 12:29 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
englebart3-Jun-22 15:35
professionalenglebart3-Jun-22 15:35 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Gerry Schmitz4-Jun-22 4:06
mveGerry Schmitz4-Jun-22 4:06 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
georani4-Jun-22 5:46
georani4-Jun-22 5:46 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Gerry Schmitz4-Jun-22 10:54
mveGerry Schmitz4-Jun-22 10:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.