473,434 Members | 1,462 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,434 software developers and data experts.

in VB, String '=' is two orders of magnitude slower than .Equals!

PJ6
Just stumbled accross this article, thought it would be interesting to
share.

Paul

http://www.thecodingmonkey.net/Perma...44590767701842
Aug 25 '06 #1
5 1003

"PJ6" <no***@nowhere.netwrote in message
news:eN**************@TK2MSFTNGP06.phx.gbl...
Just stumbled accross this article, thought it would be interesting to
share.

Paul

http://www.thecodingmonkey.net/Perma...44590767701842
The article is useless. The author's diagnosis of the problem is way off.
There's no COM interop involved. And the test is done on .NET 1.1. The
performance difference has disappeared in 2.0.

David
Aug 25 '06 #2
PJ6 wrote:
Just stumbled accross this article, thought it would be interesting to
share.

Paul

http://www.thecodingmonkey.net/Perma...44590767701842
Did you check out the link in one commenter rebuttal? I tend to
disbelieve that the = is slower because I believe that the testing
methodology was wrong.

Here is the link to a rebuttal:

http://addressof.com/blog/archive/2005/12/07/9298.aspx

Regards,

Chris

Aug 25 '06 #3
"PJ6" <no***@nowhere.netschrieb:
Just stumbled accross this article, thought it would be interesting to
share.

http://www.thecodingmonkey.net/Perma...44590767701842
I strongly recommend to read the comments on this article on the bottom of
the page referenced above.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 25 '06 #4
... And the test is done on .NET 1.1. The
performance difference has disappeared in 2.0.
For the record, my testing confirms that under fw 1.1, the (almost) 2 to 1
performance loss of '=' vs .equals is true. I'm glad to hear that the
problem is gone in 2.0.
Aug 25 '06 #5
PJ6
Sorry, my bad.

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:OV**************@TK2MSFTNGP04.phx.gbl...
"PJ6" <no***@nowhere.netschrieb:

I strongly recommend to read the comments on this article on the bottom of
the page referenced above.

Aug 28 '06 #6

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

Similar topics

14
by: Christopher Benson-Manica | last post by:
I'm trying to check whether a string is all digits. This part is easy: function allDigits( str ) { var foo=str.split( '' ); // better than charAt()? for( var idx=0; idx < foo.length; idx++ ) {...
20
by: hagai26 | last post by:
I am looking for the best and efficient way to replace the first word in a str, like this: "aa to become" -> "/aa/ to become" I know I can use spilt and than join them but I can also use regular...
19
by: David Logan | last post by:
We need an additional function in the String class. We need the ability to suppress empty fields, so that we can more effectively parse. Right now, multiple whitespace characters create multiple...
17
by: Chad Myers | last post by:
I've been perf testing an application of mine and I've noticed that there are a lot (and I mean A LOT -- megabytes and megabytes of 'em) System.String instances being created. I've done some...
8
by: Ken Wilson | last post by:
In spite of the obvious advantage of not encountering a NullReferenceException unexpectedly in your running program is there an offset cost in performance for using String.IsNullOrEmpty() over !=...
35
by: pinkfloydhomer | last post by:
How do I check if a string contains (can be converted to) an int? I want to do one thing if I am parsing and integer, and another if not. /David
26
by: Hardy Wang | last post by:
Hi all, I know it is better to handle large string with a StringBuilder, but how does StringBuilder class improve the performance in the background? Thanks! -- WWW:...
12
by: Merk | last post by:
What are some alternatives to using .ToUpper() to perform case insensitive string comparisons? The reason I'm asking is that I'm comparing strings in a long loop, looking for equality; and I...
34
by: raylopez99 | last post by:
StringBuilder better and faster than string for adding many strings. Look at the below. It's amazing how much faster StringBuilder is than string. The last loop below is telling: for adding...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.