Project

General

Profile

Bug #10895

UI Lag in V2.x due to Lua

Added by Adam Wellings almost 2 years ago. Updated almost 2 years ago.

Status:
In Progress
Priority:
Low
Assignee:
-
Category:
Darkroom
Target version:
-
Start date:
01/28/2016
Due date:
% Done:

50%

Affected Version:
2.0.0
System:
other GNU/Linux
bitness:
64-bit
hardware architecture:
amd64/x86

Description

Since upgrading to version 2, I have been getting massive UI lag at various times. Sometimes I can edit a number of images with no appreciable lag, then suddenly it will cut in and the UI will become very unresponsive. This will normally survive a restart of darktable. The lag can start on first use, so the lag can survive reboots. When this happens I normally have to give up for the day.

The lag usually (as far as I can recall) occurs in the darktable section.
It takes the form of 5-10+ second responses to the any UI action. It the action results in a hint pop-up, it can result in darktable hogging mouse input.

The lag is nothing to do with the image size as the previous version coped with these images okay, and as I say, it sometimes works no problem.
There is no obvious CPU usage increase, beyond the usual, when this happens.

The issue appeared on my upgrade to v. 2.x (I forget the version). I tried the git version and am currently running: 2.1.0+179~gf46b8fc

History

#1 Updated by Tobias Ellinghaus almost 2 years ago

  • Status changed from New to Incomplete
  • % Done changed from 0 to 20

As you are compiling dt yourself, could you please try to disable Lua at compile time? Just pass --disable-lua to build.sh or -DUSE_LUA=Off to cmake.

#2 Updated by Adam Wellings almost 2 years ago

Tobias Ellinghaus wrote:

As you are compiling dt yourself, could you please try to disable Lua at compile time? Just pass --disable-lua to build.sh or -DUSE_LUA=Off to cmake.

Thanks for the suggestion. It's currently building.
I'll give it a try and report back.

#3 Updated by Adam Wellings almost 2 years ago

Okay, that seems to have fixed it. Obviously, I may need to play some more to make sure, but it seems generally snappier even without the bad lag occurring.

Thank you very much for the workaround (I haven't used lua scripting at all, yet).

Let me know if there's anything I can do to debug the lag with Lua enabled.

#4 Updated by Adam Wellings almost 2 years ago

Adam Wellings wrote:

Okay, that seems to have fixed it. Obviously, I may need to play some more to make sure, but it seems generally snappier even without the bad lag occurring.

Thank you very much for the workaround (I haven't used lua scripting at all, yet).

Let me know if there's anything I can do to debug the lag with Lua enabled.

I think now, after some playing around with it, it's pretty safe to say that that resolves the issue.
Thank you.

I don't know if this should be marked as resolved though, unless the lua issue is a known one?

#5 Updated by Tobias Ellinghaus almost 2 years ago

  • Subject changed from UI Lag in V2.x to UI Lag in V2.x due to Lua
  • % Done changed from 20 to 10
  • Status changed from Incomplete to Confirmed

Let's keep it open. I hope we can find out what is happening. Do you have anything in ~/.config/darktable/luarc?

#6 Updated by Adam Wellings almost 2 years ago

Tobias Ellinghaus wrote:

Let's keep it open. I hope we can find out what is happening. Do you have anything in ~/.config/darktable/luarc?

Sorry for the delay, have been away for a few days.

I don't have a ~/.config/darktable/luarc

There's a darktablerc, keyboardrc, keyboardrc_default, library.db file and a styles directory.

#7 Updated by Tobias Ellinghaus almost 2 years ago

That's ok, it means that it's us who are doing something wrong and not any Lua code you might have added once.

#8 Updated by Adam Wellings almost 2 years ago

Tobias Ellinghaus wrote:

That's ok, it means that it's us who are doing something wrong and not any Lua code you might have added once.

Okay, yes I don't recall ever using anything before.

Just in case it helps, my installed Lua version is 5.3.2.

#9 Updated by Tobias Ellinghaus almost 2 years ago

Are you sure it's a "3" in the 2nd place? Because, darktable doesn't support that Lua version and shouldn't even compile. Please run ldd `which darktable` | grep lua to see what it's linked against.

#10 Updated by Adam Wellings almost 2 years ago

Tobias Ellinghaus wrote:

Are you sure it's a "3" in the 2nd place? Because, darktable doesn't support that Lua version and shouldn't even compile. Please run ldd `which darktable` | grep lua to see what it's linked against.

Sorry, my mistake. I'm using Arch and messed up my package search (missed the wildcard).
The installed package called Lua is 5.3, but there is also an installed 5.2 package (Lua52), and darktable is linked to that package (the version of Lua there, is 5.2.4).

#11 Updated by Jérémy Rosen almost 2 years ago

  • % Done changed from 10 to 50
  • Status changed from Confirmed to In Progress

ok, I have pushed a fix for the stable branch only. master will need a more complex fix

please report if you still see the problem when reenabling lua.

you will need to test with the stable branch, obviously...

#12 Updated by Adam Wellings almost 2 years ago

Jérémy Rosen wrote:

ok, I have pushed a fix for the stable branch only. master will need a more complex fix

please report if you still see the problem when reenabling lua.

you will need to test with the stable branch, obviously...

Thank you for this.

The stable is darktable-2.0.x, yes?
I've built with that branch, removing the -DUSE_LUA=Off in the cmake directives.

  • The first two times I ran the application from a shortcut key, it crashed when I double-clicked an image in Lightbox. I then ran it from the terminal and it didn't crash (no output). I ran it again from the short-cut key and again it didn't crash. I can keep this branch if you wish and monitor this.
  • Generally playing with the application - not got any images to properly work on at the moment - it seems to be as responsive as with Lua disabled. I should find time to play some more, but it looks very promising.

Again, thanks.

Also available in: Atom PDF