Fork me on GitHub
#membrane
<
2021-10-07
>
Ben Sless07:10:17

I'm trying the membrane examples. Button clicks responses are very slow. Is it intentional?

phronmophobic07:10:44

They should not be slow. What's the example you're trying?

Ben Sless07:10:36

plenty. Tried the counter and todo list. anything relating to clicks was very slow to respond. text input was snappy in file picker. In the REPL it does not happen

phronmophobic07:10:32

Is it on linux or mac?

phronmophobic07:10:26

I haven't tested as much on linux. I'm wondering if it's not repainting on mouse input for some reason

phronmophobic07:10:30

What do you mean by "in the repl"?

Ben Sless07:10:47

I copied the example from the README and pasted it in the REPL

Ben Sless07:10:52

started with lein repl

phronmophobic07:10:07

and it's not slow when run from the repl?

phronmophobic07:10:47

oh weird. One more thing to check, if you add a println in a mouse handler, is it slow to print?

phronmophobic07:10:35

That would indicate that the problem is that it's updating the state, but not repainting after mouse inputs for some reason.

Ben Sless07:10:46

Okay the behavior is even weirder

Ben Sless07:10:02

in the beginning it was slow to print and react

Ben Sless07:10:17

but if i click a button several times it reacts quickly and prints quickly

Ben Sless07:10:22

moving to another button is slow again

Ben Sless07:10:27

and speeds up after several clicks

phronmophobic07:10:02

hmmm, that is weird

phronmophobic07:10:31

another thing to check is try running the todo app with the swing backend lein run -m membrane.java2d

Ben Sless07:10:14

Everything reacts immediately

phronmophobic07:10:59

ok, that means I'm probably doing something wrong when setting up GLFW that only manifests on linux

phronmophobic07:10:47

Thanks for helping me get more info here!

Ben Sless07:10:06

Gladly, if you need a test subject feel free to ping me

phronmophobic03:10:14

@UK0810AQ2, I tried to reproduce the problem with mouse clicks being slow to respond randomly. I have a virtual box setup that runs linux, but it's kinda slow to begin with. When you describe the response as slow, would you say it's very slow, is that 1. a few seconds 2. laggy (ie. less than a second which is still really slow for responding to a mouse click) Is there any other info about your setup that might be useful? • java version • linux distro and version

Ben Sless04:10:55

The slowness itself was variable, decreasing with more clicks Initial delay can be up yo a few seconds, and eventually decreased to be unnoticeable. Clicking on a fresh button had the same issue all over again, and the same for the original button afterwards Java version - think I'm running on 15 Linux - Ubuntu 21.4 with gnome desktop, GDM, Xorg and nvidia drivers. Pretty much a stock PopOS install

Ben Sless04:10:59

Would it be helpful if I provided you with a screen recording or live demo of the issue?

phronmophobic04:10:10

yea, that would be super awesome.

phronmophobic04:10:30

yea, a few seconds is pretty wild. I hate to ask too much, but I would love to see a flame graph, https://github.com/clojure-goes-fast/clj-async-profiler. No worries if that is too much of a bother though.

Ben Sless05:10:17

No need to link flame graphs after I worked so hard to make my name synonymous with clojure performance in the past year 😄 I'll do a couple of other things, too. How does a JFR recording sound?

😆 1
phronmophobic05:10:49

What's a JFR recording?

phronmophobic05:10:23

I guess I should google it before sounding dumb

phronmophobic05:10:07

yea, that seems great

Ben Sless05:10:45

Imagine a visualvm playback with a ton of extra data

🆒 1
Ben Sless10:10:48

Well, I pulled the latest branch and can't recreate the slowness with any example

Ben Sless10:10:43

I can still run the fancy profiling etc. but I see little point now

👍 1
phronmophobic17:10:48

I did make change to reduce unnecessary draw call recently, but not sure that would directly address the symptoms. Anyway, I'll close the github issue for now and can reopen if the problem returns.

Ben Sless17:10:09

I'll be sure to report it if I stumble across it again, I like the idea of membrane and will probably bang my head against that wall to make things work with it, because it's cool

😆 1
🙏 1
phronmophobic17:10:41

Very cool. I have some cool new features in the works. Don’t hesitate to ping me if there anything I can do.

Ben Sless17:10:08

standard text editing capabilities will be 💯

Ben Sless17:10:27

just stupid text boxes with line wrap, etc

👍 1
phronmophobic07:10:45

:thumbsup: , I already have a few ideas in mind.

👍 1
Ben Sless07:10:07

Slightly easier reproducible builds would be nice, too, I would have wanted to build libmembraneskia.so myself and not have to download a release

Ben Sless07:10:32

although I see the steps now in the yml

phronmophobic07:10:34

It should be reproducible now. I use github to build it now.

Ben Sless07:10:55

yes, by bad, I didn't think to check the CI file

phronmophobic07:10:13

np, it's relatively recent.

Ben Sless07:10:33

Is it possible to build on linux without update-alternative?

phronmophobic07:10:31

I'm not sure. What's update-alternative?

Ben Sless07:10:16

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9

Ben Sless07:10:25

update-alternatives --config gcc 

Ben Sless07:10:11

With stuff like adding a ppa and globally modifying build settings, it might be better for linux users to build inside a docker image

phronmophobic07:10:47

Yea, that makes sense. I think it should compile with any c++ compiler

phronmophobic07:10:29

I think I just copied that from stack overflow as the "recommended" way to install gcc

phronmophobic07:10:15

I am not much of an expert on c++ build systems (as you may be able to tell)

Ben Sless07:10:56

I am not an expert on the subject, either 🙂

Ben Sless07:10:17

mostly fumbling my way through

Ben Sless07:10:36

ended up compiling GCC once in the hunt for missing libraries 🙃

Ben Sless07:10:30

Would you say membrane is mature enough to build an application with or should I use another framework in the meanwhile? I like the design philosophy but if I had to be practical, what would you recommend?

Ben Sless07:10:32

With the intent of targeting all operating systems

phronmophobic07:10:10

Unless it's for personal or internal company projects, I think there's probably a few missing pieces right now 😕

phronmophobic07:10:58

I'm working on getting it there, but there are still some rough edges

phronmophobic07:10:10

Since it's easy to embed, it might be possible to use membrane's cljfx or swing backends

phronmophobic07:10:37

so that you can use membrane for some things and fall back to cljfx or swing for other things

Ben Sless07:10:42

I'm not an expert with cljfx or swing, I should start with one thing

phronmophobic07:10:44

I would pick cljfx over swing, but all of my recent desktop projects for the last few years have been electron apps, which is the reason I've been working on membrane

phronmophobic07:10:06

What kind of app would it be?

Ben Sless07:10:47

An API app, which would traditionally be written in Electron

Ben Sless08:10:40

by the way, with targeting SKIA, do you have any plans for cooperation with Tonsky?

phronmophobic08:10:04

potentially. There's also a skija backend

phronmophobic08:10:10

I'm still not sure what his UI library will end up looking like, but hopefully there will be some ways to benefit from each others work.

phronmophobic08:10:44

We did a live chat on youtube about a week ago, https://www.youtube.com/watch?v=Nk6mcyv7Sz4

👍 1
Ben Sless09:10:11

Wow this is super interesting Just 💯

phronmophobic08:10:36

His chat two weeks ago with Raph Levien was really interesting, https://www.youtube.com/watch?v=PwuwG2-0n3I