Skip to content

Commit

Permalink
[OSX] Do not wait for main thread when appending to native text log
Browse files Browse the repository at this point in the history
I tracked down a huge FPS drop in my application to this line. The application was doing tons of logging to a native text log, and each one (on OSX) waits for the main thread to ack the message. The FPS difference was something like 1000 -> 30.

I don't see a reason to wait for this message to be ack'd, and things still seem to function just the same.

I did not confirm if other platforms have the same problem.
  • Loading branch information
connorjclark authored and SiegeLord committed Aug 6, 2023
1 parent cb7675f commit aaae064
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/native_dialog/osx_dialog.m
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void _al_append_native_text_log(ALLEGRO_NATIVE_DIALOG *textlog)
NSString *text = [NSString stringWithUTF8String: al_cstr(textlog->tl_pending_text)];
[view performSelectorOnMainThread:@selector(appendText:)
withObject:text
waitUntilDone:YES];
waitUntilDone:NO];

al_ustr_truncate(textlog->tl_pending_text, 0);
}
Expand Down

0 comments on commit aaae064

Please sign in to comment.