Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs
Commits:
-
760836b4
by Alexei Podtelezhnikov at 2021-06-02T14:14:41-04:00
3 changed files:
Changes:
1 |
+2021-06-02 Alexei Podtelezhnikov <apodtele@gmail.com>
|
|
2 |
+ |
|
3 |
+ * graph/grdevice.c (grDoneSurface) [GBLENDER_STATS]: Report stats.
|
|
4 |
+ * graph/gblender.c (gblender_dump_stats): Improve formatting.
|
|
5 |
+ |
|
1 | 6 |
2021-05-29 Werner Lemberg <wl@gnu.org>
|
2 | 7 |
|
3 | 8 |
Fix compilation errors and (some) warnings for clang++.
|
... | ... | @@ -412,12 +412,19 @@ Exit: |
412 | 412 |
GBLENDER_APIDEF( void )
|
413 | 413 |
gblender_dump_stats( GBlender blender )
|
414 | 414 |
{
|
415 |
- printf( "hits = %ld, miss1 = %ld, miss2 = %ld, rate1=%.2f%%, rate2=%.2f%%\n",
|
|
416 |
- blender->stat_hits,
|
|
417 |
- blender->stat_lookups,
|
|
418 |
- blender->stat_keys,
|
|
419 |
- (100.0*blender->stat_hits) / (double)(blender->stat_hits + blender->stat_lookups),
|
|
420 |
- (100.0*blender->stat_lookups) / (double)( blender->stat_lookups + blender->stat_keys)
|
|
421 |
- );
|
|
415 |
+ printf( "GBlender cache statistics:\n" );
|
|
416 |
+ printf( " Hit rate: %.2f ( %ld out of %ld )\n",
|
|
417 |
+ 100.0f * blender->stat_hits /
|
|
418 |
+ ( blender->stat_hits + blender->stat_lookups ),
|
|
419 |
+ blender->stat_hits,
|
|
420 |
+ blender->stat_hits + blender->stat_lookups );
|
|
421 |
+ |
|
422 |
+ printf( " Lookup rate: %.2f ( %ld out of %ld )\n",
|
|
423 |
+ 100.0f * blender->stat_lookups /
|
|
424 |
+ ( blender->stat_lookups + blender->stat_keys ),
|
|
425 |
+ blender->stat_lookups,
|
|
426 |
+ blender->stat_keys + blender->stat_lookups );
|
|
427 |
+ printf( " Keys used: %ld\n Caches full: %ld\n",
|
|
428 |
+ blender->stat_keys, blender->stat_clears );
|
|
422 | 429 |
}
|
423 | 430 |
#endif
|
... | ... | @@ -164,6 +164,11 @@ |
164 | 164 |
{
|
165 | 165 |
if (surface)
|
166 | 166 |
{
|
167 |
+ |
|
168 |
+#ifdef GBLENDER_STATS
|
|
169 |
+ gblender_dump_stats( surface->gblender );
|
|
170 |
+#endif
|
|
171 |
+ |
|
167 | 172 |
/* first of all, call the device-specific destructor */
|
168 | 173 |
surface->done(surface);
|
169 | 174 |
|