From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3246E5A41 for ; Fri, 22 May 2015 12:16:16 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 22 May 2015 03:16:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,474,1427785200"; d="scan'208";a="730138307" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 22 May 2015 03:16:14 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t4MAGEBW008103; Fri, 22 May 2015 11:16:14 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t4MAGEqM013082; Fri, 22 May 2015 11:16:14 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id t4MAGE8g013078; Fri, 22 May 2015 11:16:14 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Fri, 22 May 2015 11:16:05 +0100 Message-Id: <1432289771-12799-5-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1432289771-12799-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1431428560-25426-1-git-send-email-pablo.de.lara.guarch@intel.com> <1432289771-12799-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v5 04/10] test/hash: change order of loops in hash function tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2015 10:16:17 -0000 In order to see more clearly the performance difference between different hash functions, order of the loops have been changed, so it iterates first through initial values, then key sizes and then the hash functions. Signed-off-by: Pablo de Lara --- app/test/test_hash_functions.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/test/test_hash_functions.c b/app/test/test_hash_functions.c index 973fbe8..3b72e8f 100644 --- a/app/test/test_hash_functions.c +++ b/app/test/test_hash_functions.c @@ -86,8 +86,8 @@ get_hash_name(rte_hash_function f) * Test a hash function. */ static void -run_hash_func_perf_test(rte_hash_function f, uint32_t init_val, - uint32_t key_len) +run_hash_func_perf_test(uint32_t key_len, uint32_t init_val, + rte_hash_function f) { static uint8_t key[HASHTEST_ITERATIONS][RTE_HASH_KEY_LENGTH_MAX]; uint64_t ticks, start, end; @@ -122,17 +122,17 @@ run_hash_func_perf_tests(void) printf("Hash Func. , Key Length (bytes), Initial value, Ticks/Op.\n"); for (i = 0; - i < sizeof(hashtest_funcs) / sizeof(rte_hash_function); + i < sizeof(hashtest_initvals) / sizeof(uint32_t); i++) { for (j = 0; - j < sizeof(hashtest_initvals) / sizeof(uint32_t); - j++) { + j < sizeof(hashtest_key_lens) / sizeof(uint32_t); + j++) { for (k = 0; - k < sizeof(hashtest_key_lens) / sizeof(uint32_t); - k++) { - run_hash_func_perf_test(hashtest_funcs[i], - hashtest_initvals[j], - hashtest_key_lens[k]); + k < sizeof(hashtest_funcs) / sizeof(rte_hash_function); + k++) { + run_hash_func_perf_test(hashtest_key_lens[j], + hashtest_initvals[i], + hashtest_funcs[k]); } } } -- 1.7.4.1