View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0009162 | Scribus | Scripter | public | 2010-06-12 15:11 | 2012-01-23 08:27 |
Reporter | upegelow | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | x86 | OS | Linux (OpenSuse) | OS Version | 2.6.27.45 |
Product Version | 1.3.6 | ||||
Summary | 0009162: Drastic slow-down of scripter's function sizeObject | ||||
Description | I am experiencing a very strong slow-down of scripter function sizeObject since version 1.3.6. I have a small script to reproduce the effect (see below). It generates a number (nobj) of rectangular fields, puts them on some place and then does a number (nstep) of random size changes on these objects. Scribus version 1.3.5.1 on my system needs 12 seconds for 320 objects and 40 size changes. Scribus version 1.3.6 needs 5300 seconds, over one hour for the same task. This is reproducible and seems to be the same for version 1.3.7. For me this is important, as I use scribus to automatically generate a timetable out of entries in a database. A few hundred text frames need to be generated, adjusted in size (to avoid text overflows) and put into place. With the old 1.3.5.1 the job was done in a few minutes. Scribus 1.3.6 takes over 3 hours and is therefore not usable for me. | ||||
Steps To Reproduce | #!/usr/bin/python # -*- coding: utf-8 -*- import scribus import random import resource nobj=320 nstep=40 random.seed(1) scribus.newDocument((1000, 1000), (0, 0, 0, 0), scribus.LANDSCAPE, 1, scribus.UNIT_MILLIMETERS, scribus.PAGE_1, 0, 1) for i in xrange(nobj): name="field%d" % i x=(i % 10 + 1) * 40.0 y=(i / 10 + 1) * 20.0 scribus.createRect(x, y, 35, 15, name) for n in xrange(nstep): nh=random.uniform(10, 20) scribus.sizeObject(35, nh, name) print resource.getrusage(resource.RUSAGE_SELF) | ||||
Tags | No tags attached. | ||||
Patch | |||||
|
PyObject *scribus_selectobj(PyObject* /* self */, PyObject* args) { char *Name = const_cast<char*>(""); if (!PyArg_ParseTuple(args, "es", "utf-8", &Name)) return NULL; if(!checkHaveDocument()) return NULL; PageItem *i = GetUniqueItem(QString::fromUtf8(Name)); if (i == NULL) return NULL; ScCore->primaryMainWindow()->view->SelectItemNr(i->ItemNr); // Py_INCREF(Py_None); // return Py_None; Py_RETURN_NONE; } has not changed from 1.3.5.1 to 1.3.7 (to current 1.3.8svn) |
|
/* 04/07/10 returns selection if is not name specified pv */ PageItem* GetUniqueItem(QString name) { if (name.length()==0) if (ScCore->primaryMainWindow()->doc->m_Selection->count() != 0) return ScCore->primaryMainWindow()->doc->m_Selection->itemAt(0); else { PyErr_SetString(NoValidObjectError, QString("Cannot use empty string for object name when there is no selection").toLocal8Bit().constData()); return NULL; } else return getPageItemByName(name); } has not changed from 1.3.5.1 to 1.3.7 (to current 1.3.8svn) |
|
and the call to ScCore->primaryMainWindow()->view->SelectItemNr(i->ItemNr); has no underlying code changes in SelectItem via SelectItemNr |
|
Can you check the timings if the interior loop is commented out? ( for n in xrange(nstep): nh=random.uniform(10, 20) scribus.sizeObject(35, nh, name) ) |
|
With the inner loop commented out I get 10 seconds for both scribus 1.3.5.1 and 1.3.6. Maybe someone could try to reproduce my issue with the a.m. script on another system. |
|
i can confirm that the script takes very long with 1.3.8svn... |
|
This issue is a side effect of a fix which triggers additional undo action. Fixing that function will not remove those actions (they are needed), so the workaround for this issue is to disable undo in preferences. The real fix will involve adding the possibility to enable/disable undo via script. We have to find first a proper way to provide that functionality as incorrect use of the internal functions which enable/disable undo can make the whole app go awry. |
|
@jghali: Thank you for giving the workaround. I tried it directly with my timetable job and used scribus 1.3.7. Great performance now, even a 2-3 times speedup vs. 1.3.5.1. For the time being I can live very well with this workaround. And a big Thank You to the whole scribus team. A great piece of software and a fantastic support. Less than 24 hours after posting my issue I had a working solution! |
|
I re-checked the issue within the recent 1.4 series and the problem seems to be solved! |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-06-12 15:11 | upegelow | New Issue | |
2010-06-13 14:24 | cbradney | Note Added: 0024065 | |
2010-06-13 14:25 | cbradney | Note Added: 0024066 | |
2010-06-13 14:27 | cbradney | Note Added: 0024067 | |
2010-06-13 14:33 | cbradney | Note Added: 0024068 | |
2010-06-13 15:26 | upegelow | Note Added: 0024069 | |
2010-06-13 15:52 | ale | Note Added: 0024071 | |
2010-06-13 22:31 | jghali | Note Added: 0024079 | |
2010-06-13 22:31 | jghali | Note Edited: 0024079 | |
2010-06-14 16:44 | upegelow | Note Added: 0024083 | |
2010-06-14 16:50 | upegelow | Note Edited: 0024083 | |
2012-01-23 08:27 | upegelow | Note Added: 0027589 |