Platform: Linux (Ubuntu 24.04)
CoreDeck seems to be constantly redrawing even when idle, which becomes very noticeable in software-rendered environments, one example of which is the virtual machine I used to test the program (notice the high CPU usage):
Admittedly this is more of a nitpicky 'correctness' issue, most people won't be running Android emulators under conditions where this causes major problems.
me:~/CoreDeck/build$ libglx=$(ldconfig -p | awk '/libGLX.so.0/{print $NF;exit}')
me:~/CoreDeck/build$ pid=$(pidof CoreDeck)
me:~/CoreDeck/build$ sudo bpftrace -e "uprobe:$libglx:glXSwapBuffers /pid == $pid/ {@swaps = count(); } interval:s:5 {print(@swaps); exit(); }"
Attaching 2 probes...
@swaps: 244
@swaps: 244
for reference:
me:~/CoreDeck/build$ cat testredraw.c
#include <GLFW/glfw3.h>
#include <unistd.h>
int main(void) {
if (!glfwInit()) return 1;
GLFWwindow *w = glfwCreateWindow(640,480,"idle test",NULL,NULL);
glfwMakeContextCurrent(w);
glfwSwapInterval(1);
while(!glfwWindowShouldClose(w)) {
glClearColor(0.1f,0.1f,0.1f,1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(w);
sleep(1);
glfwWaitEvents();
}
glfwDestroyWindow(w);
glfwTerminate();
return 0;
}
me:~/CoreDeck/build$ gcc testredraw.c -o testredraw -lglfw -lGL
me:~/CoreDeck/build$ ./testredraw
in a different terminal:
me:~/CoreDeck/build$ libglx=$(ldconfig -p | awk '/libGLX.so.0/{print $NF;exit}')
me:~/CoreDeck/build$ pid=$(pidof testredraw)
me:~/CoreDeck/build$ sudo bpftrace -e "uprobe:$libglx:glXSwapBuffers /pid == $pid/ {@swaps = count(); } interval:s:5 {print(@swaps); exit(); }"
Attaching 2 probes...
@swaps: 0
@swaps: 0
Rerunning the last command while immediately putting the testredraw window in focus yields:
me:~/CoreDeck/build$ sudo bpftrace -e "uprobe:$libglx:glXSwapBuffers /pid == $pid/ {@swaps = count(); } interval:s:5 {print(@swaps); exit(); }"
Attaching 2 probes...
@swaps: 5
@swaps: 5
Platform: Linux (Ubuntu 24.04)
CoreDeck seems to be constantly redrawing even when idle, which becomes very noticeable in software-rendered environments, one example of which is the virtual machine I used to test the program (notice the high CPU usage):
Admittedly this is more of a nitpicky 'correctness' issue, most people won't be running Android emulators under conditions where this causes major problems.
for reference:
in a different terminal:
Rerunning the last command while immediately putting the testredraw window in focus yields: