Re: [Qemu-devel] [PATCH v2 12/12] qht-bench: add -p flag to precompute hash values

2018-09-11 Thread Emilio G. Cota
On Tue, Sep 11, 2018 at 17:46:41 -0700, Richard Henderson wrote: > On 09/10/2018 11:58 AM, Emilio G. Cota wrote: > > @@ -289,7 +297,9 @@ static void htable_init(void) > > /* avoid allocating memory later by allocating all the keys now */ > > keys = g_malloc(sizeof(*keys) * n); > > fo

Re: [Qemu-devel] [PATCH v2 12/12] qht-bench: add -p flag to precompute hash values

2018-09-11 Thread Richard Henderson
On 09/10/2018 11:58 AM, Emilio G. Cota wrote: > @@ -289,7 +297,9 @@ static void htable_init(void) > /* avoid allocating memory later by allocating all the keys now */ > keys = g_malloc(sizeof(*keys) * n); > for (i = 0; i < n; i++) { > -keys[i] = populate_offset + i; > +

[Qemu-devel] [PATCH v2 12/12] qht-bench: add -p flag to precompute hash values

2018-09-10 Thread Emilio G. Cota
Precomputing the hash values allows us to perform more frequent accesses to the hash table, thereby reaching higher throughputs. We keep the old behaviour by default, since (1) we might confuse users if they measured a speedup without changing anything in the QHT implementation, and (2) benchmarki