-first micro benchmark

This commit is contained in:
Christian Grothoff 2022-11-15 12:07:33 +01:00
parent ffbc537fe7
commit 94a80b37d5
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -98,9 +98,9 @@ run (void *cls)
goto cleanup; goto cleanup;
} }
for (unsigned int i = 0; i< 6;i++) for (unsigned int i = 0; i< 7; i++)
{ {
static unsigned int batches[]={1, 1, 2, 4, 16, 64}; static unsigned int batches[] = {1, 1, 0, 2, 4, 16, 64};
const char *sndr = "payto://x-taler-bank/localhost:8080/1"; const char *sndr = "payto://x-taler-bank/localhost:8080/1";
struct TALER_Amount value; struct TALER_Amount value;
unsigned int batch_size = batches[i]; unsigned int batch_size = batches[i];
@ -108,13 +108,13 @@ run (void *cls)
struct GNUNET_TIME_Relative duration; struct GNUNET_TIME_Relative duration;
struct TALER_ReservePublicKeyP reserve_pub; struct TALER_ReservePublicKeyP reserve_pub;
now = GNUNET_TIME_timestamp_get();
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (CURRENCY ":1.000010", TALER_string_to_amount (CURRENCY ":1.000010",
&value)); &value));
now = GNUNET_TIME_timestamp_get ();
plugin->start (plugin->cls, plugin->start (plugin->cls,
"test_by_exchange_j"); "test_by_exchange_j");
for (unsigned int k=0;k<batch_size;k++) for (unsigned int k = 0; k<batch_size; k++)
{ {
RND_BLK (&reserve_pub); RND_BLK (&reserve_pub);
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
@ -127,14 +127,14 @@ run (void *cls)
4)); 4));
} }
plugin->commit (plugin->cls); plugin->commit (plugin->cls);
duration = GNUNET_TIME_absolute_get_duration(now.abs_time); duration = GNUNET_TIME_absolute_get_duration (now.abs_time);
fprintf (stderr, fprintf (stdout,
"for a batchsize equal to %d it took %s\n", "for a batchsize equal to %d it took %s\n",
batch_size, batch_size,
GNUNET_STRINGS_relative_time_to_string(duration, GNUNET_STRINGS_relative_time_to_string (duration,
GNUNET_YES) ); GNUNET_YES) );
} }
drop: drop:
GNUNET_break (GNUNET_OK == GNUNET_break (GNUNET_OK ==
plugin->drop_tables (plugin->cls)); plugin->drop_tables (plugin->cls));
cleanup: cleanup: