From f38ea72b899c0ea5adfa1a131811c7cc84e52c01 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 8 Sep 2018 11:41:20 +0300 Subject: Hash table profiling. --- src/misc/vec/vecMem.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/misc/vec') diff --git a/src/misc/vec/vecMem.h b/src/misc/vec/vecMem.h index 72b653b7..c2bd06f0 100644 --- a/src/misc/vec/vecMem.h +++ b/src/misc/vec/vecMem.h @@ -341,10 +341,24 @@ static int * Vec_MemHashLookup( Vec_Mem_t * p, word * pEntry ) return pSpot; return pSpot; } +static void Vec_MemHashProfile( Vec_Mem_t * p ) +{ + int e; + for ( e = 0; e < 1000; e++ ) + { + int Count = 0; + int * pSpot = Vec_IntEntryP( p->vTable, e ); + for ( ; *pSpot != -1; pSpot = Vec_IntEntryP(p->vNexts, *pSpot) ) + Count++; + printf( "%d ", Count ); + } + printf( "\n" ); +} static void Vec_MemHashResize( Vec_Mem_t * p ) { word * pEntry; int i, * pSpot; + //Vec_MemHashProfile( p ); Vec_IntFill( p->vTable, Abc_PrimeCudd(2 * Vec_IntSize(p->vTable)), -1 ); Vec_IntClear( p->vNexts ); Vec_MemForEachEntry( p, pEntry, i ) -- cgit v1.2.3