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 351176 - Batching stat syscalls
Batching stat syscalls
Status: RESOLVED INCOMPLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.10.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2006-08-13 17:29 UTC by Chris Wilson
Modified: 2007-06-11 07:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Batch stat()s (31.05 KB, patch)
2006-08-13 17:30 UTC, Chris Wilson
none Details | Review

Description Chris Wilson 2006-08-13 17:29:44 UTC
By deferring stat()s to an idle handler we can coallesce repeated calls and improve user interactivity.
Comment 1 Chris Wilson 2006-08-13 17:30:38 UTC
Created attachment 70827 [details] [review]
Batch stat()s
Comment 2 Chris Wilson 2006-08-13 22:11:20 UTC
Step 1: make sure you are comparing against the correct versions.

strace during program start-up:
               % time     seconds  usecs/call     calls    errors syscall
v2.8.x:         77.53    0.529482           5    106929       567 stat64
v2.10.vanilla:   8.46    0.009094          17       549       264 stat64
v2.10.batched:   8.50    0.009368          18       529       244 stat64
Comment 3 Behdad Esfahbod 2006-08-13 22:19:22 UTC
Can you please explain those numbers?  Why was 2.8 making 200 times more calls?
And what is the effect of your patch in the numbers above?
Comment 4 Chris Wilson 2006-08-13 22:57:36 UTC
The application uses a few GtkFileChooserButtons. In v2.8 these scanned the directories (including those of the shortcuts) during creation. This behaviour was fixed in v2.10 so that only the active directory was scanned as required (on map, folder changed etc) - part of the async file chooser work, AIUI.

For example, v2.8 scanned my home directory 115 times, where as v2.10.1 not once.

The upshot is I was chasing a problem that had already been fixed. However, I think deferring the stat() to an idle handler still has merit and seems a natural fit with the async interface.
Comment 5 Xan Lopez 2007-06-11 07:17:34 UTC
Ping? Am I missing something or the numbers show this does not improve anything? In your last comment you still think the idea has merit though. Planning to do more testing? Should we close this?
Comment 6 Chris Wilson 2007-06-11 07:31:37 UTC
This is only one part of the bottleneck in displaying the FileChooser dialog and it does not alleviate the construction of the TreeView as that still waits for the entire directory to be scanned before starting.

This bug is a solution(?) searching for a problem... One day I'll make the mistake of trying to open a file from within a large directory (preferably a really slow remote fs) and be inspired to profile and measure the latency.