Author: stefan2
Date: Sun May 20 00:35:00 2012
New Revision: 1340601
URL: http://svn.apache.org/viewvc?rev=1340601&view=rev
Log:
Improve docstring. No functional change.
* subversion/libsvn_subr/hash.c
(hashfunc_compatible): further explain the assumptions made
Modified:
subversion/trunk/subversion/libsvn_subr/hash.c
Modified: subversion/trunk/subversion/libsvn_subr/hash.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/hash.c?rev=1340601&r1=1340600&r2=1340601&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/hash.c (original)
+++ subversion/trunk/subversion/libsvn_subr/hash.c Sun May 20 00:35:00 2012
@@ -568,7 +568,17 @@ svn_hash__get_bool(apr_hash_t *hash, con
/* Optimized version of apr_hashfunc_default. It assumes that the CPU has
* 32-bit multiplications with high throughput of at least 1 operation
* every 3 cycles. Latency is not an issue. Another optimization is a
- * mildly unrolled main loop.
+ * mildly unrolled main loop and breaking the dependency chain within the
+ * loop.
+ *
+ * Note that most CPUs including Intel Atom, VIA Nano, ARM feature the
+ * assumed pipelined multiplication circuitry. They can do one MUL every
+ * or every other cycle.
+ *
+ * The performance is ultimately limited by the fact that most CPUs can
+ * do only one LOAD and only one BRANCH operation per cycle. The best we
+ * can do is to process one character per cycle - provided the processor
+ * is wide enough to do 1 LOAD, COMPARE, BRANCH, MUL and ADD per cycle.
*/
static unsigned int
hashfunc_compatible(const char *char_key, apr_ssize_t *klen)