xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 3 years ago

Last modified 16 months ago

#2091 assigned defect

xdummy: xorg server slow to parse modeline config

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 4.2
Component: external Version: 2.4.x
Keywords: Cc:


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 ticket: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.

Change History (5)

comment:1 Changed 3 years ago by Antoine Martin

Status: newassigned

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

comment:2 Changed 3 years ago by Antoine Martin

Milestone: 2.54.0


comment:3 Changed 2 years ago by Antoine Martin

Milestone: 4.04.1

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

See also #1467

Last edited 17 months ago by Antoine Martin (previous) (diff)

comment:4 Changed 17 months ago by Antoine Martin

Milestone: 4.14.2

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

comment:5 Changed 16 months ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2091

Note: See TracTickets for help on using tickets.