View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0017927 | Scribus | Scripter | public | 2026-08-16 12:48 | 2026-08-29 08:25 |
| Reporter | flagsoft | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | have not tried |
| Status | closed | Resolution | no change required | ||
| Product Version | 1.6.6 | ||||
| Summary | 0017927: Make Scribus Python Scripts faster | ||||
| Description | Make Scribus Python Scripts faster I have (no so) complex Table of Contens and Header Python scripts. It goes through Text-Boxes and collects _h1, _h2, etc. and put it in a header. But it's very, very slow. 50+ pages. How can I debug-print to a console? | ||||
| Tags | No tags attached. | ||||
| Patch | No | ||||
|
|
Not sure which scripts you are using. Sadly, with the current state of the script it's not possible to make them go through all the text in a faster way. We would need to extend the API to provide a high level way to go through the text "chunk by chunk". This is something that we should do anyway, also for other features, but I'm not sure it will be done soon. What you can do right now: - Use 1.7 and it's new table of contents generator (which is in C++ and fast) - Use the table of contents (or generate a specific table of context) to collect the information for the headers and then create the headers based on it (without the need to parse the whole text). If you don't use any other features in 1.7 you should then be able to save the document again as 1.6 (there is no guarantee that the layout will be exact the same, but with a bit of luck it will be similar enough for what concerns the TOC) and use it as before. (But do some tests before modifying your production documents, and always keep backups) Finally, to get the debug output in the console, you will need to start Scribus from a console... That's easy on Linux, and that should also be doable on Mac (which according the other ticket you are using...) I would suggest to close this ticket, since there is no action that can be taken, and you're welcome to ask further questions in the forums (https://forums.scribus.net) |
|
|
Thank you for your very detailed report. I did some print() statements with timestamps. It turns out that everything which does affect page operations was/is slow Scribus-1.6.6 (stable release). So I did the same but with Scribus-1.7.4-snv (developer), from SVN source, I compiled it by myself, and it was 10 times faster then Scribus-16.6 ! Not as fast as it could be - but hey. - - - Scribus Version 1.7.4.svn Build ID: Mac-64bit-x86_64 Built: 13 April 2026 Companion Programs: Ghostscript: 10.07.1 Libraries: boost: 1.88 cairo: 1.18.4 fontconfig: 21803 harfbuzz: 14.3.1 hunspell: 1.7.2 (detected at build time) littlecms: 2190 podofo: 0.10.5 poppler: 26.08.0 - - - - - - This program uses Qt version 6.11.1. - - - |
|
|
About 120 Seconds with Scribus 1.6.6. About 12 Seconds with Scribus 1.7.4-svn. For 86 pages. |
|
|
Is it possible to use threading? So then I could re-write the script, so that it renders ONLY 1 Page at a time within a thread. This should make the scribus user interface responsive - while rendering some text on screen. https://docs.python.org/3/library/threading.html |
|
|
Scribus is generally single threaded. As said, the real solution is to add to the scripter API a function that returns chunks of text with the same formatting. |
|
|
If we get patches that make the scripter faster, I guess that we will apply them. Closing this for now, since it does not contain any actionable items (up to a vague reference to multi threading) |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-08-16 12:48 | flagsoft | New Issue | |
| 2026-08-16 20:26 | ale | Note Added: 0054216 | |
| 2026-08-16 20:26 | ale | Tag Attached: #tobeclosed | |
| 2026-08-17 15:25 | flagsoft | Note Added: 0054221 | |
| 2026-08-17 15:28 | flagsoft | Note Added: 0054222 | |
| 2026-08-17 15:39 | flagsoft | Note Added: 0054223 | |
| 2026-08-20 09:02 | ale | Note Added: 0054249 | |
| 2026-08-25 19:55 | jghali | Priority | high => normal |
| 2026-08-27 08:06 | ale | Tag Renamed | #tobeclosed => #to_be_closed |
| 2026-08-29 08:24 | ale | Tag Detached: #to_be_closed | |
| 2026-08-29 08:25 | ale | Status | new => closed |
| 2026-08-29 08:25 | ale | Resolution | open => no change required |
| 2026-08-29 08:25 | ale | Note Added: 0054368 |