in reply to Re: Comparing two arrays
in thread Comparing two arrays
Thank you
baxy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Comparing two arrays
by BrowserUk (Patriarch) on Dec 15, 2013 at 13:47 UTC | |
i'm wondering now is where does the speed come from. Perhaps the simplest way to demonstrate the difference is to look at the number of opcodes generated in order to compare and count two sets of 64 bits stored as: two arrays; two strings of ascii 1s and 0s; two bitstrings of 64 bits each. You don't need to understand the opcodes to see the reduction. Moving as much of the work (looping) into the optimised, compiled-C, opcodes just saves huge swaths of time and processor: With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
|
Re^3: Comparing two arrays
by hdb (Monsignor) on Dec 15, 2013 at 14:03 UTC | |
Just be careful to create your data as bitstrings in the first place. If you create arrays and then turn them into bitstrings to do the comparison, then it is not that fast: Result:
| [reply] [d/l] [select] |
by BrowserUk (Patriarch) on Dec 30, 2013 at 22:29 UTC | |
If you create arrays and then turn them into bitstrings [ everytime ] to do the comparison, then it is not that fast: No shit Sherlock :) With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |