From 03a34308c9af5fc91df8584e32b9efe87ae5ea96 Mon Sep 17 00:00:00 2001 From: Ven0m0 <82972344+Ven0m0@users.noreply.github.com> Date: Wed, 4 Feb 2026 16:47:46 +0000 Subject: [PATCH 1/2] feat: optimize Citra-base.ahk execution speed Added SetBatchLines, -1 to improve text processing performance. Added benchmark script for verification. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- .../Benchmark_SetBatchLines.ahk | 34 +++++++++++++++++++ Other/Citra_per_game_config/Citra-base.ahk | 1 + 2 files changed, 35 insertions(+) create mode 100644 Other/Citra_per_game_config/Benchmark_SetBatchLines.ahk diff --git a/Other/Citra_per_game_config/Benchmark_SetBatchLines.ahk b/Other/Citra_per_game_config/Benchmark_SetBatchLines.ahk new file mode 100644 index 0000000..25b3b8b --- /dev/null +++ b/Other/Citra_per_game_config/Benchmark_SetBatchLines.ahk @@ -0,0 +1,34 @@ +#NoEnv +#SingleInstance Force + +; Benchmark for SetBatchLines +; This script compares the performance of the default SetBatchLines (10ms) +; versus the optimized SetBatchLines, -1. + +Iterations := 200000 + +; --- Test 1: Default (10ms) --- +SetBatchLines, 10ms +Start1 := A_TickCount +Loop, %Iterations% +{ + var := "The quick brown fox jumps over the lazy dog" + StringReplace, var, var, o, 0, All + StringReplace, var, var, e, 3, All +} +Time1 := A_TickCount - Start1 + +; --- Test 2: Optimized (-1) --- +SetBatchLines, -1 +Start2 := A_TickCount +Loop, %Iterations% +{ + var := "The quick brown fox jumps over the lazy dog" + StringReplace, var, var, o, 0, All + StringReplace, var, var, e, 3, All +} +Time2 := A_TickCount - Start2 + +; Report results +Improvement := Round((Time1 - Time2) / Time1 * 100, 1) +MsgBox, Performance Benchmark Results:`n`nDefault (10ms): %Time1% ms`nOptimized (-1): %Time2% ms`n`nSpeed Improvement: %Improvement%`% diff --git a/Other/Citra_per_game_config/Citra-base.ahk b/Other/Citra_per_game_config/Citra-base.ahk index d27ed56..90bdc76 100644 --- a/Other/Citra_per_game_config/Citra-base.ahk +++ b/Other/Citra_per_game_config/Citra-base.ahk @@ -6,6 +6,7 @@ #SingleInstance Force ; #Warn ; Enable warnings to assist with detecting common errors. Warn needs to be off for tf library. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. +SetBatchLines, -1 #KeyHistory 0 #include %A_ScriptDir%\tf.ahk SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. From 95c7a4c97bdacb2deacc8e835f8e26cc44433bf9 Mon Sep 17 00:00:00 2001 From: Ven0m0 <82972344+Ven0m0@users.noreply.github.com> Date: Thu, 5 Feb 2026 06:49:25 +0000 Subject: [PATCH 2/2] fix(ci): unpin autohotkey.portable version to fix install failure perf(ahk): add SetBatchLines -1 to Citra-base.ahk Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- .github/workflows/ahk-lint-format-compile.yml | 2 +- .../Benchmark_SetBatchLines.ahk | 34 ------------------- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 Other/Citra_per_game_config/Benchmark_SetBatchLines.ahk diff --git a/.github/workflows/ahk-lint-format-compile.yml b/.github/workflows/ahk-lint-format-compile.yml index 95e17c5..02fc7ec 100644 --- a/.github/workflows/ahk-lint-format-compile.yml +++ b/.github/workflows/ahk-lint-format-compile.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v6 - name: Install AutoHotkey v1.1 (Portable) - run: choco install autohotkey.portable --version=1.1.37.02 -y + run: choco install autohotkey.portable -y shell: pwsh - name: Install AutoHotkey v2 diff --git a/Other/Citra_per_game_config/Benchmark_SetBatchLines.ahk b/Other/Citra_per_game_config/Benchmark_SetBatchLines.ahk deleted file mode 100644 index 25b3b8b..0000000 --- a/Other/Citra_per_game_config/Benchmark_SetBatchLines.ahk +++ /dev/null @@ -1,34 +0,0 @@ -#NoEnv -#SingleInstance Force - -; Benchmark for SetBatchLines -; This script compares the performance of the default SetBatchLines (10ms) -; versus the optimized SetBatchLines, -1. - -Iterations := 200000 - -; --- Test 1: Default (10ms) --- -SetBatchLines, 10ms -Start1 := A_TickCount -Loop, %Iterations% -{ - var := "The quick brown fox jumps over the lazy dog" - StringReplace, var, var, o, 0, All - StringReplace, var, var, e, 3, All -} -Time1 := A_TickCount - Start1 - -; --- Test 2: Optimized (-1) --- -SetBatchLines, -1 -Start2 := A_TickCount -Loop, %Iterations% -{ - var := "The quick brown fox jumps over the lazy dog" - StringReplace, var, var, o, 0, All - StringReplace, var, var, e, 3, All -} -Time2 := A_TickCount - Start2 - -; Report results -Improvement := Round((Time1 - Time2) / Time1 * 100, 1) -MsgBox, Performance Benchmark Results:`n`nDefault (10ms): %Time1% ms`nOptimized (-1): %Time2% ms`n`nSpeed Improvement: %Improvement%`%