Site
News
Files Visual Basic
Strings
Math
General
Properties
Memory
Methods Search
Testing Inline ASM-VB
Strings
Math
General
Memory Search
Using inline ASM
Submit!
News
Files Visual Basic
Strings
Math
General
Properties
Memory
Methods Search
Testing Inline ASM-VB
Strings
Math
General
Memory Search
Using inline ASM
Submit!
StrComp vs 'String1=String2'StrComp() is 100+% faster than using Ucase, for capital unsensitive strings.
I actually never knew that strComp() existed. But I think I'm going to try to implent it now where possible.
This test was based on the standard method: 500.000 iterations, 5 times.
Used Code:
User contributed notes:
Code: |
UCase$ % faster than Text compare | UCase$ (sec) | Text compare (sec) |
103,4% | 2,491938 | 1,224882 |
109% | 2,549374 | 1,219513 |
107,5% | 2,536725 | 1,222509 |
103,1% | 2,532701 | 1,246868 |
114,5% | 2,641376 | 1,231344 |
User contributed notes:
Author: PRoPHEZZoR (prophezzor at hackermail dot com) | Date: 14:04 04/04/2004 |
Cool... I never knew you could compare strings using UCase()... ... I'm so funny. |
|
Author: EACam (empyrianpale at juno dot com) | Date: 22:04 21/04/2004 |
You're right. I've never even heard of the StrComp function before. Cool. | |
Author: Sebastian Mares (sebastian at maresweb dot net) | Date: 14:05 26/05/2004 |
It seems that StrComp is slower than using the equal operator on Visual Basic 6: http://www.xbeat.net/vbspeed/c_IsSameString.htm | |
Author: Almar Joling () | Date: 18:05 26/05/2004 |
They compare case sensitive, I don't? :) | |
Author: Zoom SpellBounder () | Date: 10:06 29/06/2005 |
The use of StrComp with vbTextCompare is slower than using vbBinaryCompare. For not-so-complex strings and the use of ucase, it works better - that is, strings with chars with ASCII values between 0 and 127. Greetings, and remember: "For great justice" ;DDD |