473,327 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

.NET2.0: Performance von String-Operationen

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
Jan 23 '06 #1
1 1222
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/lib...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.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Björn Dietz" <bj*********@gmx.de> wrote in message
news:dr*************@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
Jan 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Scott H | last post by:
I spent most of yesterday looking into this, and still didn't really find an answer... I have a .NET2.0 app that I need to install on a server, and then possibly several other servers later, it...
2
by: bb | last post by:
i use the losformatter to serialise a hashtable and the store in the database. (i save some urls so they can be reconstructed) we have moved the project from asp.net1 to asp.net2 now whenever...
2
by: D. Shane Fowlkes | last post by:
ASP.NET 2 (VB) I'm experimenting with MS VWD and .NET2. I'm tinkering with the Code Behind method as demonstrated on MS's tutorial at...
0
by: Jigar.Patel | last post by:
I have simple remoting server exposing following simple method. When I try to add webreference to this server in another project by serveraddresss?wsdl, it gives me following error: Custom tool...
2
by: Patrick Smacchia | last post by:
Hi, I've just released the book Practical .NET2 and C#2. More info is available on the site http://www.PracticalDOT.NET You can download sample chapters about CLR, Security, Threading/Synchro...
1
by: Winista | last post by:
I have a library that reads PDF file and manipilates its content. And I use SharpZip library to decompress the streams included in PDF file. All well and good. I have 3 lines of my test code that...
4
by: hvj | last post by:
I need to run a .NET1.1 program in a .NET2.0 CLR. The .NET1.1 exe starts correctly in .NET2.0. Now I want to debug in Visual Studio 2005. But when I try to open the .NET1.1 project, Visual Studio...
4
by: InnoCreate | last post by:
Hi everyone, I've developed a couple of asp.net1.1 websites and these are viewable using my mobile phone. I've now moved over to asp.net2 and i'm unable to view asp.net2 websites on my phone. I've...
0
by: Groove | last post by:
(repost!) I have a simple and common scenario. I'm developing pages in VWD and FTP-ing them over to a test servr running Window 2003, NET2 Framework. On my page, I have a DDL that causes a...
4
by: dreamamit2001 | last post by:
Hi, I would like to know the ASP.NET2.0's(Controls, Menubar, Validations, Object Data Souce Controls, Treeview Control) compatibility with IE5.0 browser on Mac OS. If I don't use Client side...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.