Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance when running as a dedicated server #6402

Closed
DorpsGek opened this issue Dec 16, 2015 · 2 comments
Closed

Improve performance when running as a dedicated server #6402

DorpsGek opened this issue Dec 16, 2015 · 2 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

JGR opened the ticket and wrote:

The attached patch makes some minor changes to improve performance when running headlessly as a dedicated server by omitting drawing-related operations which are not required.

No longer update/redraw windows and viewports in dedicated mode.

This has a quite significant performance cost when the result will only be thrown away by the null blitter anyway.
No longer call UpdateWindows in main loop, which renders dirty windows and viewports.
No longer update vehicle sprite IDs or mark dirty vehicles in viewports.

This was measured to save 50% - 65% of dedicated server total CPU time in test games (using gprof).
Two gprof traces of the same test game run on a dedicated server with no command inputs for the same start and end game dates are attached for reference.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6402
@DorpsGek
Copy link
Member Author

frosch wrote:

I kept the call to UpdateWindows, but instead returned from UpdateWindows after the calls to ProcessScheduledInvalidations.
Otherwise I think this would result in ever-growing/leaking queues.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6402#comment14188

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Implemented

in r27579. Thanks for the patch!


This comment was imported from FlySpray: https://bugs.openttd.org/task/6402

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant