aboutsummaryrefslogtreecommitdiff
path: root/src/datacache/perf_datacache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datacache/perf_datacache.c')
-rw-r--r--src/datacache/perf_datacache.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c
index 94cd7a58e..fd3891116 100644
--- a/src/datacache/perf_datacache.c
+++ b/src/datacache/perf_datacache.c
@@ -45,10 +45,10 @@ static const char *plugin_name;
45 45
46static int 46static int
47checkIt (void *cls, struct GNUNET_TIME_Absolute exp, 47checkIt (void *cls, struct GNUNET_TIME_Absolute exp,
48 const GNUNET_HashCode * key, size_t size, const char *data, 48 const struct GNUNET_HashCode * key, size_t size, const char *data,
49 enum GNUNET_BLOCK_Type type) 49 enum GNUNET_BLOCK_Type type)
50{ 50{
51 if ((size == sizeof (GNUNET_HashCode)) && (0 == memcmp (data, cls, size))) 51 if ((size == sizeof (struct GNUNET_HashCode)) && (0 == memcmp (data, cls, size)))
52 found++; 52 found++;
53 return GNUNET_OK; 53 return GNUNET_OK;
54} 54}
@@ -59,8 +59,8 @@ run (void *cls, char *const *args, const char *cfgfile,
59 const struct GNUNET_CONFIGURATION_Handle *cfg) 59 const struct GNUNET_CONFIGURATION_Handle *cfg)
60{ 60{
61 struct GNUNET_DATACACHE_Handle *h; 61 struct GNUNET_DATACACHE_Handle *h;
62 GNUNET_HashCode k; 62 struct GNUNET_HashCode k;
63 GNUNET_HashCode n; 63 struct GNUNET_HashCode n;
64 struct GNUNET_TIME_Absolute exp; 64 struct GNUNET_TIME_Absolute exp;
65 struct GNUNET_TIME_Absolute start; 65 struct GNUNET_TIME_Absolute start;
66 unsigned int i; 66 unsigned int i;
@@ -76,14 +76,14 @@ run (void *cls, char *const *args, const char *cfgfile,
76 } 76 }
77 exp = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS); 77 exp = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS);
78 start = GNUNET_TIME_absolute_get (); 78 start = GNUNET_TIME_absolute_get ();
79 memset (&k, 0, sizeof (GNUNET_HashCode)); 79 memset (&k, 0, sizeof (struct GNUNET_HashCode));
80 for (i = 0; i < ITERATIONS; i++) 80 for (i = 0; i < ITERATIONS; i++)
81 { 81 {
82 if (0 == i % (ITERATIONS / 80)) 82 if (0 == i % (ITERATIONS / 80))
83 FPRINTF (stderr, "%s", "."); 83 FPRINTF (stderr, "%s", ".");
84 GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n); 84 GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n);
85 ASSERT (GNUNET_OK == 85 ASSERT (GNUNET_OK ==
86 GNUNET_DATACACHE_put (h, &k, sizeof (GNUNET_HashCode), 86 GNUNET_DATACACHE_put (h, &k, sizeof (struct GNUNET_HashCode),
87 (const char *) &n, 1 + i % 16, exp)); 87 (const char *) &n, 1 + i % 16, exp));
88 k = n; 88 k = n;
89 } 89 }
@@ -96,12 +96,12 @@ run (void *cls, char *const *args, const char *cfgfile,
96 GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS, 96 GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS,
97 "ms/item"); 97 "ms/item");
98 start = GNUNET_TIME_absolute_get (); 98 start = GNUNET_TIME_absolute_get ();
99 memset (&k, 0, sizeof (GNUNET_HashCode)); 99 memset (&k, 0, sizeof (struct GNUNET_HashCode));
100 for (i = 0; i < ITERATIONS; i++) 100 for (i = 0; i < ITERATIONS; i++)
101 { 101 {
102 if (0 == i % (ITERATIONS / 80)) 102 if (0 == i % (ITERATIONS / 80))
103 FPRINTF (stderr, "%s", "."); 103 FPRINTF (stderr, "%s", ".");
104 GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n); 104 GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n);
105 GNUNET_DATACACHE_get (h, &k, 1 + i % 16, &checkIt, &n); 105 GNUNET_DATACACHE_get (h, &k, 1 + i % 16, &checkIt, &n);
106 k = n; 106 k = n;
107 } 107 }