From 73f09de29db76b9ca5d93904d15698ff9fe336e5 Mon Sep 17 00:00:00 2001 From: Martijn Courteaux Date: Tue, 21 May 2024 15:25:23 +0200 Subject: [PATCH] Fix savings calculation. --- profiler/src/profiler/TracyView_Compare.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiler/src/profiler/TracyView_Compare.cpp b/profiler/src/profiler/TracyView_Compare.cpp index 61338963..57fba756 100644 --- a/profiler/src/profiler/TracyView_Compare.cpp +++ b/profiler/src/profiler/TracyView_Compare.cpp @@ -968,7 +968,7 @@ void View::DrawCompare() TextFocused( "Savings:", TimeToString( total1 * adj1 - total0 * adj0 ) ); ImGui::SameLine(); char buf[64]; - PrintStringPercent( buf, ( total0 * adj0 ) / ( total1 * adj1 ) * 100 ); + PrintStringPercent( buf, (1.0 - ( total0 * adj0 ) / ( total1 * adj1 )) * 100 ); TextDisabledUnformatted( buf ); TextFocused( "Max counts:", cumulateTime ? TimeToString( maxVal ) : RealToString( floor( maxVal ) ) );