rabbibotton / clog

CLOG - The Common Lisp Omnificent GUI
Other
1.48k stars 101 forks source link

Very slow clog-builder #247

Closed simendsjo closed 5 months ago

simendsjo commented 1 year ago

Selecting components takes several seconds while populating the list on the right. Tested with sbcl 2.2.10 on Linux 6.1-rc6 with FF nightly 107 and Chromium 107.0.5304.110. What's a good way to try to locate the source of this? sb-sprof? Some web tools?

rabbibotton commented 1 year ago

Are you using the latest builder? Do a (ql:update-all-dists) Was it working well and then became slow?

On Tue, Nov 22, 2022 at 2:34 PM simendsjo @.***> wrote:

Selecting components takes several seconds while populating the list on the right. Tested with sbcl 2.2.10 on Linux 6.1-rc6 with FF nightly 107 and Chromium 107.0.5304.110. What's a good way to try to locate the source of this? sb-sprof? Some web tools?

— Reply to this email directly, view it on GitHub https://github.com/rabbibotton/clog/issues/247, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYUEFMKL4BHHV5MNKW7NOLWJUN27ANCNFSM6AAAAAASIFW6OQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

simendsjo commented 1 year ago

Are you using the latest builder? Do a (ql:update-all-dists) Was it working well and then became slow?

Cloned from github. Tried using the version in Ultralisp, but get the same behavior. I haven't been using it before, so I'm not sure when it became slow. Here's a screenshot of what's happening when I press a button in the gui builder. As you can see, it takes several seconds and looks quite chatty.

image

rabbibotton commented 1 year ago

The builder is a fairly chatty app with the browser, but on the same machine it is very responsive (for others :) Ok, so let see in chrome open -> more tools -> developer tools Let me know if see anything on the console in the dev tools should be just:

connecting to ws://127.0.0.1:8080/clog connection successful

rabbibotton commented 1 year ago

I am upgrading sbcl now also to 2.2.10 so let's see if I see a diff with that.

simendsjo commented 1 year ago

Let me know if see anything on the console in the dev tools should be just:

I get the following errors: image

simendsjo commented 1 year ago

This is what I got in FF, but I got it already when opening a new panel editor. image

rabbibotton commented 1 year ago

I'll look into why those errors show on Linux (not seeing it on Mac), something do to with setting up the ctrl key handlers, but that would not create an issue beyond the ctrl-s key not saving.

sbcl 2.2.10 on Mac works well. So not that either.

Later today I'll try and run through test in my Linux box.

To confirm the slow down is in the CLOG Builder when editing a .clog file or in the Project Window when you start?

simendsjo commented 1 year ago

To confirm the slow down is in the CLOG Builder when editing a .clog file or in the Project Window when you start?

In the Builder when selecting a component as the right and bottom-left panels are being filled. I can move and resize the components without any lag. So it looks like it's related to loading these panels.

rabbibotton commented 1 year ago

Perfect, I will run some tests. Will find it :)

simendsjo commented 1 year ago

Tested on Windows 10 with sbcl 2.2.5 now, and everything is snappy :+1: So related to Linux, sbcl 2.2.10, something locally on my machine or similar.

rabbibotton commented 1 year ago

I still didn't have chance to run some tests on my linux box, so will keep ticket active a bit longer.

rabbibotton commented 1 year ago

I am seeing sluggish performance on 2.1.11 on Ubuntu Linux, I will try and track down what is causing it.

rabbibotton commented 1 year ago

Just keeping you in loop, it is not a race condition on the clog side, so will take me a bit longer. It must be that some property I am requesting takes longer for the browser to answer about on Linux then on Windows or Mac. Still a bit strange.

simendsjo commented 1 year ago

Yes, seem to remember it indicated a relation to polling, so it might be below clog.

simendsjo commented 1 year ago

Same result with SBCL 2.2.11. But I tried just moving the mouse, which causes a lot of poll requests. Could this be related? Moving the mouse for 10s triggered 12k poll events and quite a lot of CPU usage. I don't have a Windows box handy, so I cannot check if this is Linux specific.

image

rabbibotton commented 1 year ago

will hunt down the speed issue soon, just been busy with the non-virtual issues this week (flying around a bit, new grand child etc)

simendsjo commented 1 year ago

(..) new grand child (..)

Congratulations! The true joys of live :)

(..) will hunt down the speed issue soon (..)

No stress, I'm just adding some information that might be relevant as I investigate. Don't know how to profile clog/CL yet though.

rabbibotton commented 1 year ago

I made a change in the builder that should increase speed considerably. Can you please update to head and let me know how it is working on your system? sorry for the long delay

simendsjo commented 1 year ago

I made a change in the builder that should increase speed considerably. Can you please update to head and let me know how it is working on your system? sorry for the long delay

It's a lot faster, but it's still pretty slow. It also looks like it's doing the same operation several times.

https://user-images.githubusercontent.com/351519/206778557-10244a68-02d8-49b2-b8c9-fa9d5e627d00.mp4

rabbibotton commented 1 year ago

fantastic, I will look in to why repeating the selections and I have a few more optimizations. It seems the bottle neck is the actual UI elements on Linux UIs, in particular the drop downs. For example take a look at the update to the left/right while dragging an object around, hundreds of round trip network msgs no issue. On Mac these are all lightening fast.

simendsjo commented 1 year ago

By pressing the button back and forth, it looks like I triggered a race condition of some sort. Probably unrelated..?

image

rabbibotton commented 5 months ago

The errors and speed issues should be cleared up. Sorry for delays. Please reopen ticket seeing lags.