View Issue Details

IDProjectCategoryView StatusLast Update
0017047ScribusOS-MacOSXpublic2023-11-14 09:02
ReportermangaTengu Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version1.5.8 
Summary0017047: Scribus slows down as you make manipulations to the point of needing a restart
DescriptionI make a lot of manipulations in scribus, especially changing objects' layers and duplicating elements.
As I work each of those manipulations becomes more and more laggy to the point I need to wait 30 seconds or more for an operation to finish.
When it's too much, I restart the program.
When working i can restart every 10 minutes or so...
Steps To ReproduceDo a lot of copying, changing layers...
I can provide my working file and some scripts to batch a lot of operations.
Additional InformationMy working file handles heavy images (median weight ~10mb)
Those are .kra files.
I generally have 40 to 80 images, each one on a page (I publish a webtoon)
Tagsperformance
PatchNo

Activities

ale

2023-11-11 07:53

manager   ~0050431

interesting report!

would it possible for you to share a screencast of your work?

from what you are saying, it might be possible to reproduce your workflow and detect what is the reason for the slow down....

mangaTengu

2023-11-11 08:04

reporter   ~0050432

Thank you!
Sure, I will record the screen and share the video soon.
I see uploads are limited to 2MB here. Is there a prefered alternative file sharing service ?

ale

2023-11-11 08:51

manager   ~0050433

no, no preferences.
even a file temporarily uploaded to google drive or your website will do : - )

mangaTengu

2023-11-13 06:00

reporter   ~0050443

Hello again,
I had a hard time with OBS, lots of records went to trash...
But I finally have one. I didn't know how to speed up reproduction of the lag so I ended up. working for real and watching performance degrade as I go.
Since I didn't make lots of manipulations (didn't call batch scripts etc) degradation took time to build up.
Lag is nothing like 30 seconds. Maybe more like 3 (I guess the extra 0 is my mind is more proportional to annoyance lol) but it really is killing the work experience.

Here is a nearly 30 minutes session, you can see layer changing being instantaneous at the beginning and extremely laggy at the end:
https://drive.google.com/file/d/1hmuV6Pfq5gysEgwiR7iQTS6IOCPt82to/view?usp=sharing

Here is just a small video showing a bit of lag already built up (at second 26):
https://drive.google.com/file/d/1mybk_nr51SmmE07IsGmIDqMtlQjjN3lu/view?usp=sharing

ale

2023-11-13 19:23

manager   ~0050444

do i understand it well?

after some time (about 20 minutes in the above screencast), sending items to a different layers becomes slower (and slower).
most, it not all, other actions are still fast.

and when you restart scribus, you can restart your work and now sending to other layers is fast again.

i've has a look at the code for sending items to other layers and i could not see anything that could explain the lag.
the only "dangerous" part seems to be where the undo actions get registered.
but that is code that is common to many other commands.

so, do you notice other actions getting slower or it's only that one command?

btw, i wanted to try to replicate but running scripts that randomly move around items, but the code for the scripter is rather different (much simpler, no undo) and it's unlikely that it would also happen there. (and i'm not sure that i want to spend half an hour manually creating random frames and moving them to other frames : - )

ale

2023-11-13 20:14

manager   ~0050445

Last edited: 2023-11-13 20:17

i could not resist and i have created a script:

### copy from here

import scribus
import string
import random

number_of_pages = 50

scribus.newDocument(scribus.PAPER_A4_MM, (10, 10, 10, 10), scribus.PORTRAIT, 1, scribus.UNIT_MILLIMETERS, scribus.PAGE_1, 0, 1)
the_layer = scribus.getActiveLayer()
scribus.createLayer('the-other-layer')
scribus.setActiveLayer(the_layer)

for i in range(1, number_of_pages):
    scribus.gotoPage(i)
    item_name = scribus.createText(20, 20, 100, 20)
    scribus.selectObject(item_name)
    content = ''.join(random.choice(string.ascii_lowercase) for i in range(random.randint(4, 10)))
    scribus.setText(content)
    scribus.createBezierLine([20, 20, 25, 25, 30, 30, 35, 35, 40, 20, 15, 15])
    scribus.sendToLayer('the-other-layer')
    scribus.newPage(-1)

### copy until here

it creates a document with 50 pages and two layers.
with some text in there, a bezier curve, and moves the text to the other layer

if you know how to run scripts you can copy and try if you can trigger the same problem on your computer by changing the number of pages created

i've run it with:

- 1000 pages (in a first version without the beziers), it took some time to finish but i could not notice anything special
- 5000 pages (and the beziers) and i had to wait for a longer time (a few minutes) and the resulting document is not really usable:
  - i can scroll around correctly,
  - the creation of new frames is sluggish,
  - triggering the context menu is sluggish,
  - but once the context menu is there moving the item to a new layer is snappy.
  - closing and reopening scribus does not change a thing.

JLuc

2023-11-13 21:08

developer   ~0050447

Last edited: 2023-11-13 22:04

5000 pages is unusually big a document.
This issue doesnt seem related with the page count, but with the "change layer" count.
Maybe looping on the change layer instruction would better fit as this issue's test.

mangaTengu

2023-11-13 21:14

reporter   ~0050448

Hello,

Once the lag has set in, even if not changing layers, just popping and closing the menu will trigger the lag.
btw I'm running on a macbook pro 16' (M1).

About the script
50 pages goes in a few seconds
150 pages takes a couple minutes or so (like much much more)
1000 It's been running 10 minutes and counting, but if it goes as I suspect, it will be hours.
5000 that's for another day :)

mangaTengu

2023-11-13 21:26

reporter   ~0050449

(20 minutes for the 1000 pages)

ale

2023-11-14 07:28

manager   ~0050451

@mangaTengu, the question is if -- after having run the script -- you can normally work in scribus, not how much it takes to run the script itself (i only have mentioned the times, in order to make you aware that it might take several minutes to complete).
there is no need to run it for extreme numbers.

the goal is to understand what might leading to the slowdown.

from the results you have given, i wonder if you are already seeing the slowdown: i have a just slightly more than entry level linux laptop and it seems to be much faster than what you get (it might depend on the memory available...)

following jluc comment, here is a modified version of the script that creates 10 frames per page on 150 pages.
it takes a bit longer on my machine to run, but after having run the script, i don't get any slowdown when using scribus.

 import scribus
import string
import random

number_of_pages = 150

scribus.newDocument(scribus.PAPER_A4_MM, (10, 10, 10, 10), scribus.PORTRAIT, 1, scribus.UNIT_MILLIMETERS, scribus.PAGE_1, 0, 1)
the_layer = scribus.getActiveLayer()
scribus.createLayer('the-other-layer')
scribus.setActiveLayer(the_layer)

for i in range(1, number_of_pages):
    scribus.gotoPage(i)
    for j in range(10):
        item_name = scribus.createText(20, 20 + 20 * j, 100, 20)
        scribus.selectObject(item_name)
        content = ''.join(random.choice(string.ascii_lowercase) for i in range(random.randint(4, 10)))
        scribus.setText(content)
        scribus.sendToLayer('the-other-layer')
    scribus.createBezierLine([20, 20, 25, 25, 30, 30, 35, 35, 40, 20, 15, 15])
    scribus.newPage(-1)

one of the next few evening i might try to modify the sendToLayer command from the script to use the same code as in the context menu ... (and probably then propose it as a patch, since it's about adding the command as an undo action..)

mangaTengu

2023-11-14 08:57

reporter   ~0050455

Ah sorry. Had I understood you wanted a quick way to do a lot of operations to build the laggy state, I would have shared my scripts and working file and spared you the hassle...
nonetheless, your script is efficient: on the 150 pages script, it took 90 seconds to change one object's layer!

About my memory, I have 13GB of free ram (no change during the 90 seconds of lag)

mangaTengu

2023-11-14 09:02

reporter   ~0050456

btw I mainly mentioned my device to remember anyone reading this that I'm on macOS.
Just from an ignorant user perspective, when I begun using macOS I had a lot of drawbacks in any floss...(libreoffice, krita, scribus...) so when encountering such issue, I'm always certain it's specific to the OS...

Issue History

Date Modified Username Field Change
2023-11-11 06:13 mangaTengu New Issue
2023-11-11 06:13 mangaTengu Tag Attached: performance
2023-11-11 07:53 ale Note Added: 0050431
2023-11-11 08:04 mangaTengu Note Added: 0050432
2023-11-11 08:51 ale Note Added: 0050433
2023-11-11 10:29 jghali Priority high => normal
2023-11-13 06:00 mangaTengu Note Added: 0050443
2023-11-13 19:23 ale Note Added: 0050444
2023-11-13 20:14 ale Note Added: 0050445
2023-11-13 20:15 ale Note Edited: 0050445
2023-11-13 20:16 ale Note Edited: 0050445
2023-11-13 20:17 ale Note Edited: 0050445
2023-11-13 21:08 JLuc Note Added: 0050447
2023-11-13 21:09 JLuc Note Edited: 0050447
2023-11-13 21:14 mangaTengu Note Added: 0050448
2023-11-13 21:26 mangaTengu Note Added: 0050449
2023-11-13 22:04 JLuc Note Edited: 0050447
2023-11-14 07:28 ale Note Added: 0050451
2023-11-14 08:57 mangaTengu Note Added: 0050455
2023-11-14 09:02 mangaTengu Note Added: 0050456