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

GUI I/O has ~1 second delay #34

Open
ghost opened this issue Feb 8, 2023 · 4 comments
Open

GUI I/O has ~1 second delay #34

ghost opened this issue Feb 8, 2023 · 4 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Feb 8, 2023

Every time I move the mouse or type something in the terminal (while running the GUI), there is ~1 second delay between me moving the mouse, and the cursor actually moving on the screen.
The issue is happening to me in QEMU while using multiple computers for virtualization (Linux x64 host, and macOS m1 host with emulated x86_64 hardware). Not sure if it happens with any other hypervisors.

@dennis95
Copy link
Owner

dennis95 commented Feb 8, 2023

It is unfortunately a known issue that the GUI does not have good performance. The cause for the mouse lag is that the window is being redrawn for every mouse packet received: https://github.com/dennis95/dennix/blob/master/libdxui/src/events.c#L491
The performance impact depends on the used hardware and the display resolution.

The redraw should only happen after all mouse packets were processed and the redraw should be limited to the area the cursor was in before and after all packets were processed.

Another performance issue in the GUI is #35.

@dennis95 dennis95 self-assigned this Feb 8, 2023
@dennis95 dennis95 added this to the Dennix 0.9 milestone Feb 8, 2023
@ghost
Copy link
Author

ghost commented Feb 9, 2023

I don't have much time to look through the code, but from what I understood the whole screen gets redrawn on every interrupt (note: I might be wrong).
If that's the case, functions from here and here could be implemented so that the redraw happens only on the regions which are affected by the mouse (i.e. there's no reason to redraw the terminal window if we move the mouse on the desktop). The same thing should happen when typing - redraw only the terminal window when we type.

This really pumped up the performance of my own window manager (virtually no flickering even without the use of double buffering)

@Dashbloxx
Copy link

Run with KVM:

qemu-system-x86_64 -accel kvm -cdrom dennix.iso

This should really make the mouse work normally/more instantly.

Or, run it on bare metal, which should work even better.

@ajh123
Copy link

ajh123 commented Jul 15, 2023

Running inside Virtual Box seems less slower for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants