|
-
BlinkOK,
Feel free to correct, but I believe the array of integers would be just as fast, or faster. After all, a string is simply an array of characters (8 bit integers) wrapped in a convenient object. One would assume the array would be faster as it would not have the overhead of the String wrapper, and you would not need to split or substr out required characters each time you test (unless you did it once, in which case you would simply wind up with an array again - which would then have to be converted to binary integers in the background for bitwise operations to work --> back where we started).
I suppose there's a chance it would be faster if bitwise operators have been optimized in MX. You could certainly use bitwise operators to optimize the code I posted slightly (using bitwise shift instead of multiplying by 2,4,8), but the resulting speed gain would be insignificant.
Even if there is a small optimization to be gained, I doubt the additional complexity to the code would be worth it (unless you are already very familiar with using bitwise operators).
If you'd like some info on bitwise operators, here is an old article that is a good introduction:
http://builder.cnet.com/webbuilding/...ripter/082698/
Just my 2c,
ZE.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|