beatoraja icon indicating copy to clipboard operation
beatoraja copied to clipboard

Issue: logging to file incurs intermittent frame drops

Open phu54321 opened this issue 1 year ago • 2 comments

Logger.getGlobal().info etc incurs file operation, which intermittently stalls the application.

20241212_213948_idea64_lFHfiiZXMn

Solutions

  1. Make File Handler asynchronous: https://github.com/exch-bms2/beatoraja/blob/91d975358619fb0cb9acc3b267897a2872d29ec5/src/bms/player/beatoraja/MainLoader.java#L58C48-L58C56
  2. Add a checkbox to disable logging to file.

phu54321 avatar Dec 12 '24 12:12 phu54321

Hi @phu54321 beatoraja doesn't produce many logs itself, could you check if you have this similar exception:

严重: スコア取得時の例外:[SQLITE_TOOBIG] String or BLOB exceeds size
limit (statement too long) Query: SELECT * FROM score WHERE sha256 IN
(...)`

This exception is happening when you have a very big BMS directory and beatoraja is trying to join every sha256 together into a massive sql statement. Then exception message(the huge sha256 string) is vomiting to your log file, which might be the real issue. I was working on a patch(Catizard/lr2oraja-endless-dream:fix/sql_too_long@560c7ca) to fix this and can be dropped in beatoraja directly

Catizard avatar Dec 15 '24 01:12 Catizard

Hello, this issue was found in accident. I encountered an occasional frame drops, and I trird to profile the application. The profiling code created a lot of logs (less than 100kb/s), and it even created more frame drops. I tried profiling it with jfrtofp, and on some system, specifically mine, BufferedWriter takes more than 1s to close, and it incurred a frame drop.

Will test if this weird long file close behavior exists on beatoraja main client itself without excessive logging.

phu54321 avatar Dec 15 '24 01:12 phu54321