I'm currently sitting in an airplane, but when I get a chance I will look into this. There really is no reason this should be so slow.
-- Ed Sent from my iPhone, so please excuse any top-posting. On Feb 20, 2011, at 12:44 PM, Rasmus Schøler Sørensen <[email protected]> wrote: > Hi, > > First, as this is my first post to the dabo mailinglist, I would like > to show my gratitude to Ed, Paul, Nate, John, Jacek and Uwe for their > great work on the Dabo framework and their frequent contributions to > the mailing-lists. Thank you. > > I recently tried to use the ClassDesigner to create a dPanel, which I > then included in a form using the following in my form's afterInit: > (bizobj instantiations...) > self.super() > self.Sizer = dabo.ui.dSizer("h") > PanelClass = dabo.ui.createClass("ui/PanSolutionsImport.cdxml", > show=False, parent=self) > self.Panel = PanelClass(self) > self.Sizer.append(self.Panel, "expand", proportion=1, valign="middle") > self.Sizer.layout() > > Unfortunately, I found that instantiation of my form was terribly > slow, more than 12 sec! Obviously 12 sec instantiation is not > normal/expected behavior even for widgets created using the > classdesigner. I have already coded a similar form using the > classdesigner to create the whole dForm (and not just the panel), and > this instantiates in about 1 sec (from initProperties start to > afterInitAll end). Also, if I add a normal "handcoded" dPanel, it > instantiates in 1/10th of a second. > > Is this a known issue? Or am I just doing something wrong? I've added > some info below that might shed some light on the situation, and on > request I can also show you the full cdxml's etc, but the issue > doesn't seem to depend on the particular panel. (I've also made a few > ad-hoc test panels to confirm the issue and they are all very slow.) > > > > Best regards, > > Rasmus Sorensen > > > > > > ------------- SUPPLEMENTARY INFORMATION: ------------------------------------- > > I used the following to time the instantiation: > starttime = datetime.datetime.now() > self.Panel = PanelClass(self) > endtime = datetime.datetime.now() > print endtime - starttime > > and it is indeed the line "self.Panel = PanelClass(self)" that is the > source of the slow instantiation. I did a quick investigation to see > if there was a particular object in my cd-panel which was causing > this. My panel has a main vertical sizer with two slots, where the top > consists of three border-sizers with an average of 8 controls in each > (labels, textboxes, checkboxes, buttons, a radio-list and a single > dropdown list). The lower slot in the main sizer has a PageFrame with > three tabs, two of which has a grid.) This original panel took 12.3 > sec to instantiate. I then started deleting objects to find the > source. After removing the PageFrame and the lower slot, time was > about 9 sec, removing one of the bordersizers reduced instantiation > time to 7.3 sec, and 3 sec after deleting the second bordersizer. A > single dPanel with a button and a label takes 0.8 sec to instantiate. > > In conclusion, there doesn't seem to be a single cause for the slow > instantiation, but rather every single object in the dPanel adds a > quite considerable time to the instantiation. It also takes a > considerable amount of time to open the panel's cdxml file using the > class-designer (usually the classdesigner opens a cdxml file in 4 sec, > but in this case it takes more than 16 sec). > > As mentioned, if I create a whole form in using the classdesigner, it > instantiates much faster, so my best guess is that there is some kind > of bad loop going on when instantiating cdxml panels. I have also > noted that the classdesigner add a lot of "default" properties to the > cdxml elements (which it omits when saving a complete panel). But, the > I know I could just continue to create complete forms with the > classdesigner, but I think that the optimal workflow for me is to use > the classdesigner to create the UI layout and then be able to code the > form with all it's logic using my normal editor (Spyder or vim). > > > Sysinfo: > Ubuntu 10.10 > Python 2.6.6 > Wx-config 2.8.11.0 > Dabo revision: 6450 (svn) - I recall there was a recent issue with > panels in the ClassDesigner, but my panels have been created _after_ > that was fixed by Ed. > > PS: A few other things... > 1) I noticed that dGridSizer::append1x(obj) method isn't really valid, > as the dGridSizer's append doesn't accept a "proportion" argument. > 2) dBizObj::requery() tries to perform the following: oldDataStructure > = hash(self.DataStructure). In my case, this raised a TypeError > because DataStructure is a list, which is un-hashable. > _______________________________________________ > Post Messages to: [email protected] > Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users > Searchable Archives: http://leafe.com/archives/search/dabo-users > This message: > http://leafe.com/archives/byMID/[email protected] > _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
