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

xdummy: xorg server slow to parse modeline config #2091

Closed
totaam opened this issue Dec 27, 2018 · 4 comments
Closed

xdummy: xorg server slow to parse modeline config #2091

totaam opened this issue Dec 27, 2018 · 4 comments
Labels
bug Something isn't working linux
Milestone

Comments

@totaam
Copy link
Collaborator

totaam commented Dec 27, 2018

Now that we have thousands of modelines in the xdummy config (r16160), the server can take too long to startup. ie: r20970
This is more of a problem on low-power devices: #1777

This was recorded in #1557#comment:11: This makes the Xdummy server a little bit slower to start, so r16252 increases the timeout used in the automated tests.

Looking at the Xorg server code, there is a 3-level nested loop on modelines in xf86ValidateModes.

The middle loop reads: If the supplied mode names don't produce a valid mode, scan through unconsidered modePool members until one survives validation. This is done in decreasing order by mode pixel area.
The innermost loop, never actually triggers anything, its docstring says: Deal with the case where this mode wasn't considered because of a builtin mode of the same name
With a thousand modeline entries, we can end up running the strcmp millions of times...

We should be able to re-work that code to achieve the same results with a lot less CPU time.
On a decent CPU this can take multiple seconds, it should be doable under 100ms.

@totaam
Copy link
Collaborator Author

totaam commented Dec 27, 2018

This also explains why the unit tests have been failing occasionally.

@totaam
Copy link
Collaborator Author

totaam commented Mar 5, 2020

Less of a problem recently? Did this get fixed or improved already?

See also #1467

@totaam
Copy link
Collaborator Author

totaam commented Jan 13, 2021

Less of a problem as Debian builds have reverted to Xvfb: #2834

@totaam totaam added the v2.4.x label Jan 22, 2021
@totaam totaam added bug Something isn't working linux and removed v2.4.x labels Jan 23, 2021
@totaam totaam added this to the 5.0 milestone Jan 23, 2021
@totaam
Copy link
Collaborator Author

totaam commented Jul 7, 2022

Made irrelevant by the switch to dynamic randr resolutions in #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linux
Projects
None yet
Development

No branches or pull requests

1 participant