2 ms·
Kudos to you for actually doing the experiment! With a control case even! I wish I could give you ten upvotes.
by lisper 8y ago
Kudos to you for actually doing the experiment! With a control case even! I wish I could give you ten upvotes.
- pantalaimon 8y agoWell kudos to you for having the right theory! I would have never assumed this behavior on modern CPUs. That trick might still be useful in the embedded space - I had to try it on my samr21-xpro too (with only an 8kiB array and slightly modified code - http://codepad.org/aPOZraI2 http://codepad.org/aPOZraI2) samr21 (Cortex M0+) naive search found: 0, took 1714 ticks found: 0, took 1713 ticks found: 0, took 1714 ticks found: 0, took 1714 ticks found: 0, took 1714 ticks found: 0, took 1713 ticks found: 0, took 1714 ticks found: 0, took 1713 ticks found: 0, took 1714 ticks found: 0, took 1714 ticks average: 1713 ticks knuth search found: 0, took 1372 ticks found: 0, took 1372 ticks found: 0, took 1372 ticks found: 0, took 1372 ticks found: 0, took 1372 ticks found: 0, took 1372 ticks found: 0, took 1372 ticks found: 0, took 1372 ticks found: 0, took 1372 ticks found: 0, took 1372 ticks average: 1372 ticks