Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs
Commits:
-
ecaa7996
by Alexei Podtelezhnikov at 2022-08-22T23:08:10-04:00
2 changed files:
Changes:
... | ... | @@ -167,6 +167,7 @@ gblender_init( GBlender blender, |
167 | 167 | #ifdef GBLENDER_STATS
|
168 | 168 | blender->stat_hits = 0;
|
169 | 169 | blender->stat_lookups = 0;
|
170 | + blender->stat_clashes = 0;
|
|
170 | 171 | blender->stat_keys = 0;
|
171 | 172 | blender->stat_clears = 0;
|
172 | 173 | #endif
|
... | ... | @@ -308,6 +309,9 @@ NewNode: |
308 | 309 | #endif
|
309 | 310 | |
310 | 311 | Exit:
|
312 | +#ifdef GBLENDER_STATS
|
|
313 | + blender->stat_clashes += ( idx - idx0 ) & (GBLENDER_KEY_COUNT-1);
|
|
314 | +#endif
|
|
311 | 315 | return key->cells;
|
312 | 316 | }
|
313 | 317 | |
... | ... | @@ -399,6 +403,9 @@ NewNode: |
399 | 403 | #endif
|
400 | 404 | |
401 | 405 | Exit:
|
406 | +#ifdef GBLENDER_STATS
|
|
407 | + blender->stat_clashes += ( idx - idx0 ) & (GBLENDER_KEY_COUNT-1);
|
|
408 | +#endif
|
|
402 | 409 | return (unsigned char*)blender->cells + key->index;
|
403 | 410 | }
|
404 | 411 | |
... | ... | @@ -421,6 +428,7 @@ gblender_dump_stats( GBlender blender ) |
421 | 428 | blender->stat_lookups,
|
422 | 429 | blender->stat_lookups - blender->stat_keys,
|
423 | 430 | blender->stat_lookups );
|
431 | + printf( " Clashes: %ld\n", blender->stat_clashes );
|
|
424 | 432 | printf( " Keys used: %ld\n Caches full: %ld\n",
|
425 | 433 | blender->stat_keys, blender->stat_clears );
|
426 | 434 | }
|
... | ... | @@ -107,6 +107,7 @@ |
107 | 107 | #ifdef GBLENDER_STATS
|
108 | 108 | long stat_hits; /* number of direct hits */
|
109 | 109 | long stat_lookups; /* number of table lookups */
|
110 | + long stat_clashes; /* number of table clashes */
|
|
110 | 111 | long stat_keys; /* number of table key recomputation */
|
111 | 112 | long stat_clears; /* number of table clears */
|
112 | 113 | #endif
|