4 ms·
I will say, while this is interesting and fun to see, using a trivial library like SDL adds almost nothing to the overhead and expands support to non *nix OSes.
by deaddodo 2y ago
I will say, while this is interesting and fun to see, using a trivial library like SDL adds almost nothing to the overhead and expands support to non *nix OSes.
There is definitely something to be said of bloat but probably not in this case. You could even keep supporting Linux versions as old as this promises by using legacy 1.x SDL.
- jandrese 2y ago"adds almost nothing to the overhead" is not always true. In the example code in the article he kept the pixbuf in the local X Server memory for low overhead and fast performance over the network. SDL always wants to send the pixmaps over the network. This is not a big deal for Minesweeper, but can be tough for action games.
- deaddodo 2y agoYou're just outlining a major flaw in the X Server protocol, not SDL. That's a unique situation to that specific system due to it's intrinsic network-oriented design and specifically the issue Wayland was designed to handle, which doesn't have this issue. In addition, there are solutions for cache locality of the pixbuf for SDL that you can code around, if you specifically need higher performance X11 code on Linux.
- jandrese 2y agoThe article just described how he was able to avoid this flaw in X11 by being mildly careful in how he structured his code. Making sure to do the bitmap copy only once and then issuing copyrect() calls to the server to have it do all of the blitting locally. With SDL it generally wants to do all of the blitting on the client and then push the whole window over as a giant pixmap for every frame. At least that's what it has done when I've tried to use it.
- immibis 2y agoIt's debatably even a flaw. Network transparency is pretty cool. This Minesweeper probably runs faster over an internet SSH tunnel to Australia than any pixel-based remote desktop protocol. You feel it's a flaw because you only ever run applications locally. But more constraints are a side effect of more possibilities, because you have to program the lowest common denominator of all possible scenarios, so your program works in all of them. That's how APIs work. They all have this tradeoff.
- nottorp 2y agoSay, Wayland doesn't and will never support remote displays will it?
- immibis 2y agoDoesn't and never will. It's all based around transferring pixel data. You can write a VNC-like wayland proxy, which has been done (it's called waypipe) but it will never be as performant as something designed for minimal network traffic. Waypipe will never be able to blit sprites locally on the server, because Wayland clients don't do that.
- jandrese 2y agoThe only flaw is that there is an inefficient way to do it and you just have to know that and choose the correct way instead.
- account42 2y agoBeing able to support efficient use over the network is a flaw now? Wayland "solves" that flaw the same way that death cures disease and suffering.
- kbolino 2y agoHasn't it been the case, for quite some time now, that VNC and RDP are more efficient over the network than X11 for modern graphical apps? Client-side font rendering, antialiasing, full-color graphics, alpha-blending, etc. have as far as I know neutered all of the benefits that X11 originally intended to deliver in terms of "efficient" network use.
- immibis 2y agoIt has, but only because X11 apps are programmed in ways that don't work well on slow networks. They are programmed so poorly for networks that VNC works better. You can write a network-efficient one if you want to, and it will work better than VNC. Meanwhile, all Wayland apps work the VNC way, by design.
- kbolino 2y agoI guess I don't understand why this comes off like a bad thing. X11 has ossified badly. Web apps directly achieve the goals of network transparency in a cross-platform way. Remote desktop works better in practice with VNC and RDP and those solutions are also cross-platform. Maybe in a world without Windows and macOS, X11's architecture would have been more relevant and would have evolved more. But looking at the state of affairs today, it just looks like a half-baked solution to a problem that doesn't quite exist.
- immibis 2y agoI guess I don't understand why this comes off like a bad thing. What do you mean badly? We can make X12 that will fix the few actual insane points in an incompatible way (e.g. delete the concept of colourmaps, and declare some policy for window management events). Web apps are no better than X11, which is also cross-platform. Remote desktop only works better with apps that are developed to work better with remote desktop - which is all the major frameworks, but should we settle for the status quo or strive for improvement? (if we shouldn't strive for improvement, then why Wayland?). Other than moving the WM in-process and deleting the drawing commands you need to draw stuff and requiring co-operation of five different extensions for core features that are builtin operations in X11, how is Wayland's architecture much different from X11's again?
- kragen 2y agosdl uses shared memory in the usual case, i think