i try to export energy stats to file (so i can use them for my led strip), i want something like a satisfaction bar in reallive

unfortunately my solution causes fpsdrops (1 each 60 tick).
do u know a "better" method to read values like produced energy and "used" energy?
i have only 2.3k Accumlators, 1.8k solar panels and 53 steamengines, without my mod its fine.
attached my "mod".