freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master e6040f1: * graph/gblender.c (gblender_dump_stat


From: Werner Lemberg
Subject: [freetype2-demos] master e6040f1: * graph/gblender.c (gblender_dump_stats): Fix the lookup rate.
Date: Fri, 4 Jun 2021 22:27:12 -0400 (EDT)

branch: master
commit e6040f12a39a83b0787e113621357446dc92feb3
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * graph/gblender.c (gblender_dump_stats): Fix the lookup rate.
---
 ChangeLog        |  4 ++++
 graph/gblender.c | 12 ++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 14725a0..d4162b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * graph/gblender.c (gblender_dump_stats): Fix the lookup rate.
+
 2021-06-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
        * graph/grdevice.c (grDoneSurface) [GBLENDER_STATS]: Report stats.
diff --git a/graph/gblender.c b/graph/gblender.c
index 87f9ea9..6d94dde 100644
--- a/graph/gblender.c
+++ b/graph/gblender.c
@@ -413,17 +413,17 @@ GBLENDER_APIDEF( void )
 gblender_dump_stats( GBlender  blender )
 {
   printf( "GBlender cache statistics:\n" );
-  printf( "  Hit rate:    %.2f ( %ld out of %ld )\n",
+  printf( "  Hit rate:    %.2f%% ( %ld out of %ld )\n",
           100.0f * blender->stat_hits /
                    ( blender->stat_hits + blender->stat_lookups ),
           blender->stat_hits,
           blender->stat_hits + blender->stat_lookups );
 
-  printf( "  Lookup rate: %.2f ( %ld out of %ld )\n",
-          100.0f * blender->stat_lookups /
-                   ( blender->stat_lookups + blender->stat_keys ),
-          blender->stat_lookups,
-          blender->stat_keys + blender->stat_lookups );
+  printf( "  Lookup rate: %.2f%% ( %ld out of %ld )\n",
+          100.0f * ( blender->stat_lookups - blender->stat_keys ) /
+                   blender->stat_lookups,
+          blender->stat_lookups - blender->stat_keys,
+          blender->stat_lookups );
   printf( "  Keys used:   %ld\n  Caches full: %ld\n",
           blender->stat_keys, blender->stat_clears );
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]