public static int getMaxSerializedBytes ( final int lgK ) { checkLgK ( lgK ) ; if ( lgK <= 19 ) { return empiricalMaxBytes [ lgK - 4 ] + 40 ; } final int k = 1 << lgK ; return ( int ) ( 0.6 * k ) + 40 ; // 0.6 = 4.8 / 8.0 }
The actual size of a compressed CPC sketch has a small random variance but the following empirically measured size should be large enough for at least 99 . 9 percent of sketches .