Skip to content

Commit

Permalink
WIP bdz-compat2"
Browse files Browse the repository at this point in the history
  • Loading branch information
rurban committed May 5, 2024
1 parent f22d27e commit 88db989
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORDS = /usr/share/dict/words
RANDBIG = _randbig
RANDHEX = _randhex

$(PROG): $(SRCS) mi_vector_hash.c mi_vector_hash.h wyhash.h nbtool_config.h VERSION
$(PROG): $(SRCS) mi_vector_hash.c $(HEADERS) nbtool_config.h VERSION
$(CC) $(CFLAGS) -DVERSION="\"$(shell cat VERSION)\"" -DHAVE_NBTOOL_CONFIG_H $(SRCS) \
mi_vector_hash.c -o $@ -lm
perf: perf.h perf_test.c perf.cc
Expand Down
9 changes: 6 additions & 3 deletions fnv3.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ static inline void fnv32_3(const void *key, size_t len, uint32_t seed,
h1 = seed + 1;
h2 = seed + 2;
while (data < end) {
h0 += (h0 << 1) + (h0 << 4) + (h0 << 7) + (h0 << 8) + (h0 << 24); //from cpmh
h1 += (h1 << 1) + (h1 << 4) + (h1 << 7) + (h1 << 8) + (h1 << 24); //from cpmh
h2 += (h2 << 1) + (h2 << 4) + (h2 << 7) + (h2 << 8) + (h2 << 24); //from cpmh
h0 *= 0x01000193;
h1 *= 0x01000193;
h2 *= 0x01000193;
//h0 += (h0 << 1) + (h0 << 4) + (h0 << 7) + (h0 << 8) + (h0 << 24); //from cpmh
//h1 += (h1 << 1) + (h1 << 4) + (h1 << 7) + (h1 << 8) + (h1 << 24); //from cpmh
//h2 += (h2 << 1) + (h2 << 4) + (h2 << 7) + (h2 << 8) + (h2 << 24); //from cpmh
h0 ^= *data;
h1 ^= *data;
h2 ^= *data;
Expand Down
2 changes: 1 addition & 1 deletion graph2.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ SIZED2(_hash)(struct nbperf *nbperf, struct SIZED(graph) * graph)
e->vertices[2] = hashes[2] % graph->r + (graph->r << 1);
#endif
}
DEBUGP("Key[%lu]: %s (%u, %u, %u)\n", i, nbperf->keys[i],
DEBUGP("Key[%lu]: \"%s\" (%u %u %u)\n", i, nbperf->keys[i],
e->vertices[0], e->vertices[1], e->vertices[2]);
for (j = 0; j < GRAPH_SIZE; ++j) {
//if (nbperf->hashes16)
Expand Down
1 change: 1 addition & 0 deletions nbperf-bdz.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ assign_nodes(struct state *state)
size_t i, j;

memset(state->g, 0xff, state->g_size);
DEBUGP("e: %u, v: %u, va: %u, r: %u\n", state->graph.e, state->graph.v, state->graph.va, state->graph.r);
//for (i = 0; i < state->graph.v; ++i)
// SETI2(state->g, i, UNVISITED);

Expand Down
2 changes: 1 addition & 1 deletion nbperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ main(int argc, char **argv)
nbperf.keylens = keylens;

/* with less keys we can use smaller and esp. faster 16bit hashes */
if (curlen <= 65534) {
if (curlen <= 1 /*65534*/) {
nbperf.hashes16 = 1;
if (build_hash == chm_compute) {
if (nbperf.intkeys > 0) {
Expand Down

0 comments on commit 88db989

Please sign in to comment.