Author: stefan2
Date: Tue Aug 19 11:11:44 2014
New Revision: 1618841
URL: http://svn.apache.org/r1618841
Log:
Remove fast_memcpy and replace it with standard memcpy.
In the long gone past, clients and FSFS repositories used self-delta
within their txdelta data. That created patterning copies as well
as other short-length copy ops. Since then, these formats have become
much less prevalent, caching has reduced the need for fast parsing
and compiler intrinsics have improved. Not using standard memcpy
doesn't by us much anymore.
* subversion/libsvn_delta/text_delta.c
(fast_memcpy): Remove.
(patterning_copy,
svn_txdelta_apply_instructions): Call memcpy instead.
Modified:
subversion/trunk/subversion/libsvn_delta/text_delta.c
Modified: subversion/trunk/subversion/libsvn_delta/text_delta.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/text_delta.c?rev=1618841&r1=1618840&r2=1618841&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/text_delta.c (original)
+++ subversion/trunk/subversion/libsvn_delta/text_delta.c Tue Aug 19 11:11:44
2014
@@ -623,39 +623,6 @@ size_buffer(char **buf, apr_size_t *buf_
return SVN_NO_ERROR;
}
-/* Copy LEN bytes from SOURCE to TARGET, optimizing for the case where LEN
- * is often very small. Return a pointer to the first byte after the copied
- * target range, unlike standard memcpy(), as a potential further
- * optimization for the caller.
- *
- * memcpy() is hard to tune for a wide range of buffer lengths. Therefore,
- * it is often tuned for high throughput on large buffers and relatively
- * low latency for mid-sized buffers (tens of bytes). However, the overhead
- * for very small buffers (<10 bytes) is still high. Even passing the
- * parameters, for instance, may take as long as copying 3 bytes.
- *
- * Because short copy sequences seem to be a common case, at least in
- * "format 2" FSFS repositories, we copy them directly. Larger buffer sizes
- * aren't hurt measurably by the exta 'if' clause. */
-static APR_INLINE char *
-fast_memcpy(char *target, const char *source, apr_size_t len)
-{
- if (len > 7)
- {
- memcpy(target, source, len);
- target += len;
- }
- else
- {
- /* memcpy is not exactly fast for small block sizes.
- * Since they are common, let's run optimized code for them. */
- while (len--)
- *target++ = *source++;
- }
-
- return target;
-}
-
/* Copy LEN bytes from SOURCE to TARGET. Unlike memmove() or memcpy(),
* create repeating patterns if the source and target ranges overlap.
* Return a pointer to the first byte after the copied target range. */
@@ -670,13 +637,13 @@ patterning_copy(char *target, const char
const apr_size_t overlap = target - source;
while (len > overlap)
{
- target = fast_memcpy(target, source, overlap);
+ target = memcpy(target, source, overlap);
len -= overlap;
}
/* Copy any remaining source pattern. */
if (len)
- target = fast_memcpy(target, source, len);
+ target = memcpy(target, source, len);
return target;
}
@@ -703,7 +670,7 @@ svn_txdelta_apply_instructions(svn_txdel
/* Copy from source area. */
assert(sbuf);
assert(op->offset + op->length <= window->sview_len);
- fast_memcpy(tbuf + tpos, sbuf + op->offset, buf_len);
+ memcpy(tbuf + tpos, sbuf + op->offset, buf_len);
break;
case svn_txdelta_target:
@@ -720,9 +687,9 @@ svn_txdelta_apply_instructions(svn_txdel
case svn_txdelta_new:
/* Copy from window new area. */
assert(op->offset + op->length <= window->new_data->len);
- fast_memcpy(tbuf + tpos,
- window->new_data->data + op->offset,
- buf_len);
+ memcpy(tbuf + tpos,
+ window->new_data->data + op->offset,
+ buf_len);
break;
default: