You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/11/23 02:23:46 UTC
svn commit: r1544730 -
/subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c
Author: stefan2
Date: Sat Nov 23 01:23:45 2013
New Revision: 1544730
URL: http://svn.apache.org/r1544730
Log:
Reduce the time spent in named atomic tests. Modern multi-core CPUs still
execute 10s of thousands of iterations even with the reduced timings.
* subversion/tests/libsvn_subr/named_atomic-test.c
(calibrate_iterations): quicker calibration; reduce actual test for .2 secs
(calibrate_concurrency): 8x concurrency is good enough as a limit
Modified:
subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c
Modified: subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c?rev=1544730&r1=1544729&r2=1544730&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c Sat Nov 23 01:23:45 2013
@@ -390,9 +390,9 @@ calibrate_iterations(apr_pool_t *pool, i
int calib_iterations;
double taken = 0.0;
- /* increase iterations until we pass the 100ms mark */
+ /* increase iterations until we pass the 50ms mark */
- for (calib_iterations = 10; taken < 100000.0; calib_iterations *= 2)
+ for (calib_iterations = 10; taken < 50000.0; calib_iterations *= 2)
{
apr_pool_t *scratch = svn_pool_create(pool);
SVN_ERR(init_concurrency_test_shm(scratch, count));
@@ -404,16 +404,16 @@ calibrate_iterations(apr_pool_t *pool, i
svn_pool_destroy(scratch);
}
- /* scale that to 1s */
+ /* scale that to .2s */
- suggested_iterations = (int)(1000000.0 / taken * calib_iterations);
+ suggested_iterations = (int)(200000.0 / taken * calib_iterations);
return SVN_NO_ERROR;
}
/* Find out how far the system will scale, i.e. how many workers can be
* run concurrently without experiencing significant slowdowns.
- * Sets HW_THREAD_COUNT to a value of 2 .. 32 (limit the system impact in
+ * Sets HW_THREAD_COUNT to a value of 2 .. 8 (limit the system impact in
* case our heuristics fail) and determines the number of iterations.
* Can be called multiple times but will skip the calculations after the
* first successful run.
@@ -432,7 +432,7 @@ calibrate_concurrency(apr_pool_t *pool)
if (svn_named_atomic__is_efficient() && proc_found(TEST_PROC, pool))
{
SVN_ERR(calibrate_iterations(pool, 2));
- for (; hw_thread_count < 32; hw_thread_count *= 2)
+ for (; hw_thread_count < 8; hw_thread_count *= 2)
{
int saved_suggestion = suggested_iterations;