|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
.NET2.0: Performance von String-Operationendoes someone have experience concerning the performance with string operations in .net2? for example, which code (a or b) is quicker when executed a million times: a) DIM x1 AS STRING = " TEST " DIM x2 AS STRING = TRIM(x1) b) DIM x1 AS STRING = " TEST " DIM x2 AS STRING = x1.TRIM I have to parse through very large files, so even a small difference would make a significant difference for the final program. thanks in advance! bjoern Björn,
Why not setup a couple of test programs & find out? For timing .NET 1.x programs I normally use QueryPerformanceCounter: http://support.microsoft.com/kb/306978/en-us In .NET 2.0 I normally use the new StopWatch class. http://msdn2.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx However!! rather then worry if VB.Trim is faster then String.Trim up front. I would worry about writing the program first, at least prototype the program first. Then use either CLR Profiler or another profiling tool to find the bottlenecks. I would then optimize those bottle necks. -- Show quoteHide quoteHope this helps Jay [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "Björn Dietz" <bjoerndi***@gmx.de> wrote in message news:dr370r$2os$00$1@news.t-online.com... | Hello, | | does someone have experience concerning the performance with string | operations in .net2? | | for example, which code (a or b) is quicker when executed a million times: | | a) | DIM x1 AS STRING = " TEST " | DIM x2 AS STRING = TRIM(x1) | | b) | DIM x1 AS STRING = " TEST " | DIM x2 AS STRING = x1.TRIM | | I have to parse through very large files, so even a small difference | would make a significant difference for the final program. | | thanks in advance! | | bjoern
Modifying a text file
disable Close button (X) Application doesn't close on Shut Down - Please help! Using pulldownlist in datagridview .. can it be done! Update error Intern Strings - am I using them right? Please help! Marking a changed row read the contents of Address bar in browser Error- Type expected stringbuilder help |
|||||||||||||||||||||||