-
quick notes
I'm just getting started in VB, but I have good knowledge of c++ so I'll make some points I encountered on reading this thread. First, memcpy accepts pointers as its first arguments. I'm still not clear about this in VB, but it looked like the above tried to put bytes in them?
Also, real pickiness here so ignore if not interested, but O(n) = O(n/2). The O operator in math ignores coefficients and is used mainly to compare different types of increases (linear v. quadratic, etc.). But the above algorithm would either not give a halving of time, or would not solve the comparison properly if I followed it correctly. Anyways, this is an O(n) problem but you can optimize by taking out some of the loop comparisons by "unwinding" it and comparing groups of numbers if your willing to state some byte boundaries to declare your array on (ie. declare array sizes in only multiples of four, etc.). Also should take out any extraneous material from inner loop. But using an optimized API seems best.
Anyway, just looking through the threads and trying to learn. If my post is off target in any way, I appologize. This is an interesting discussion that has already taught me some important VB lessons!
-
Ok, the RtlCompareMemory really kicks a$$. It get's the job done in 5,668877 ms.
The downpart of this is that is only runs on Nt/2K/XP.
Anyway, it is worth mentioning though.
-
What about MD5 checksum comparison?
-
Another idea
Maybe not a smart one, but I can say that it works fine.
In some cases, maybe Cakkies' too, we can control the creation of the arrays and check the stored data at that time plus setting some kind of flags. So when the time comes to check the arrays the only thing we have to do is to check that flags, not the actual contents. In simple words the actual search takes place on the fly when the arrays are updating its elements one at a time (data store time).
This is very tricky when you have time when loading elements, and do not have much when the compare must be done.
-
Well, moreover in this situation instead of eventualy checking for the screen changes we can implement a hook routine to effeciently notify the remote for such changes. But this is much more advanced and more complicated than simply using the timer to generate the event...
However, StrComp function is the fastest way over other straight-forward or conceptual functions, but believe this no one has ever cited the InStrB function which is suppose to be second in the rank.
Cheers everyone!;)