After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 117072 - Object hierarchy traversed 6 times
Object hierarchy traversed 6 times
Status: RESOLVED FIXED
Product: gok
Classification: Deprecated
Component: performance
unspecified
Other Solaris
: High normal
: ---
Assigned To: bill.haneman
bill.haneman
Depends on:
Blocks: 109187 118134
 
 
Reported: 2003-07-09 16:30 UTC by padraig.obriain
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Stack traces when gok_spy_has_child is called (8.35 KB, text/plain)
2003-07-09 16:32 UTC, padraig.obriain
  Details
initial patch for this problem (review - not suitable for commit) (61.28 KB, patch)
2003-11-28 14:42 UTC, bill.haneman
none Details | Review
latest patch against gok HEAD (68.71 KB, patch)
2003-12-08 14:23 UTC, bill.haneman
none Details | Review
latest patch, with previous major issues resolved. Ready to commit after removal of debug output?. (97.19 KB, patch)
2004-01-07 13:49 UTC, bill.haneman
none Details | Review
final patch as committed, except for ChangeLog entry. (85.12 KB, patch)
2004-01-20 00:22 UTC, bill.haneman
none Details | Review

Description padraig.obriain 2003-07-09 16:30:50 UTC
I ran gok and yelp.

In gok I chose Activate and then chose the yelp window.
The children of a particular object in yelp were got 6 times.
This seems to be because gok requested them.
Comment 1 padraig.obriain 2003-07-09 16:32:08 UTC
Created attachment 18180 [details]
Stack traces when gok_spy_has_child is called
Comment 2 David Bolter 2003-07-09 17:55:02 UTC
There are certainly optimizations that can be done in gok-spy.  One
thing we don't want to maintain is any off screen model (which we
modify based on events).  But traversing a subtree several times is
wasteful, I think using bitflags for both a role type in variable and
for a return out variable might be a way to go.

Currently gok traverses looking for a menu, traverses again looking
for a toolbar, and again looking for buttons...  it all depends what
branch keys are on the current keyboard.  (all three of these happen
to be on main)

All this validation of dynamic branch keys is triggered by focus events.
Comment 3 korn 2003-07-09 23:25:13 UTC
Good catch.  This is an important one, especially for things like 
StarOffice.  Optimizing for a single (or perhaps at most two) tree 
traversal is probably one of our highest priority performance bugs.
Comment 4 bill.haneman 2003-08-19 12:49:47 UTC
yes, this is a known issue.  Fixing it will require some redesign and
should wait post-2.4.
Comment 5 bill.haneman 2003-08-19 12:51:57 UTC
BTW I am not sure bitflags in the params are the most attractive
solution; OTOH they can be returned in the gok-specific structs
returned in the object list built by gok_spy_find_children et al. 
Perhaps we need a gok-specific GokComponentMatchCondition struct to
build and pass in.
Comment 6 bill.haneman 2003-08-19 12:53:21 UTC
I can take this one as time permits.
Comment 7 David Bolter 2003-08-19 14:21:59 UTC
Something like the "GokComponentMatchCondition" does sounds
attractively flexible. 
Comment 8 bill.haneman 2003-09-19 17:25:06 UTC
OK, I will plan to work on this next week (i.e. end Sept. 2003)
Comment 9 bill.haneman 2003-09-19 17:26:07 UTC
before I commit changes, can we come up with a good 'test case' for a
benchmark (that's currently too slow), so we can assess whether/how
much we improved things?  maybe you could do that David... :-) ?
Comment 10 David Bolter 2003-09-19 19:25:19 UTC
maybe - but ideally we need a dedicated machine for that...  is there
such a beast over there?
Comment 11 David Bolter 2003-09-19 19:39:41 UTC
Actually perhaps Malte Timmermann could give us a good Star Office
test case...  Also, David Hawthorne has posted related java slowness
issues I think...


Comment 12 bill.haneman 2003-09-23 11:07:18 UTC
I don't think we need a 'dedicated machine' - we just need a specific
test case with benchmark timings on a specific architecture, i.e.

"operation foo took 23.56 seconds on a 400 MHz sparc Ultra 10"
or
"ditto on a 600 MHz PIII with 256MB RAM" (assuming a few things like
no swapping, and using the second invocation of a run to minimize
paging-related issues)

The benchmark doesn't have to be terribly formally exacting I think,
just a specific operation.  Probably we need to add some timing blurbs
to GOK or gok_log once we agree on the operations which are the most
annoyingly slow.
Comment 13 bill.haneman 2003-10-09 16:46:26 UTC
adding accessibility keyword
Comment 14 bill.haneman 2003-10-21 11:39:38 UTC
bumping up priority as this is a serious performance issue for some
applications (for instance StarOffice).
Comment 15 bill.haneman 2003-11-14 15:30:17 UTC
I'll start on this one next week (W/E Nov 21).
Comment 16 bill.haneman 2003-11-28 14:42:59 UTC
Created attachment 21898 [details] [review]
initial patch for this problem (review - not suitable for commit)
Comment 17 bill.haneman 2003-12-05 11:59:57 UTC
adding PATCH keyword - but bear in mind that the patch isn't yet ready
to apply.
Comment 18 David Bolter 2003-12-05 14:58:34 UTC
Wow.  Quite the patch.  If you are still having bugs with it, don't
forget you can build with the --enable-logging-normal and
--enable-logging-exceptional flags to get some human readable trace
messages...  The trace can often be very revealing.
Comment 19 bill.haneman 2003-12-08 14:23:40 UTC
Created attachment 22218 [details] [review]
latest patch against gok HEAD
Comment 20 bill.haneman 2004-01-07 13:49:36 UTC
Created attachment 23066 [details] [review]
latest patch, with previous major issues resolved. Ready to commit after removal of debug output?.
Comment 21 bill.haneman 2004-01-07 14:16:15 UTC
spoke too soon, this patch still has major issues.
Comment 22 bill.haneman 2004-01-20 00:22:12 UTC
Created attachment 23541 [details] [review]
final patch as committed, except for ChangeLog entry.
Comment 23 bill.haneman 2004-01-20 00:23:59 UTC
Fixed in CVS!

David Hawthorne, could you test this against the former benchmark for
StarOffice to see how much this impacts the performance issue?  Maybe
you'll need to re-benchmark before updating GOK and running it (with
this new code).

This patch was very big, and I haven't tested really hard since
finding the main bug that was offending, so hammering on the new GOK
code to see if it's robust is probably a good idea.