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 560360 - Excessive statting when reading binary cache
Excessive statting when reading binary cache
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal minor
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-11 15:35 UTC by Simon Holm Thøgersen
Modified: 2008-11-24 09:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Reduce the number of stat calls for each plugin from 3 to 1 (2.28 KB, patch)
2008-11-11 15:48 UTC, Simon Holm Thøgersen
none Details | Review
registry: reduce the number of stat calls for each plugin from 3 to 1. (2.27 KB, patch)
2008-11-24 02:52 UTC, Simon Holm Thøgersen
committed Details | Review

Description Simon Holm Thøgersen 2008-11-11 15:35:59 UTC
Please describe the problem:
gst_registry_scan_path_level() stats the same file three times when one would be enough.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Simon Holm Thøgersen 2008-11-11 15:48:17 UTC
Created attachment 122426 [details] [review]
Reduce the number of stat calls for each plugin from 3 to 1
Comment 2 Sebastian Dröge (slomo) 2008-11-12 10:08:51 UTC
Win32 probably doesn't have S_IFREG and S_IFDIR, this should be checked before this can go in... and maybe we need some win32 specific code as GLib has for g_file_test. Otherwise the patch looks good :)
Comment 3 Jan Schmidt 2008-11-12 14:03:56 UTC
I think win32 has _S_IFREG and _S_IFDIR instead, which should be mapped with some #defines at the top.
Comment 4 Simon Holm Thøgersen 2008-11-12 19:03:10 UTC
(In reply to comment #3)
> I think win32 has _S_IFREG and _S_IFDIR instead, which should be mapped with
> some #defines at the top.

Yes, but I guess the same applies for struct stat where win32 should have struct _stat?

I know that struct stat is something the glib interface for g_stat specifies, but the thing is that I cannot see glib do anything special to define this.

Anyway, I completely admit to knowing nothing about Windows in this regard.

Also, I'm not sure whether the patch should use g_stat instead of stat. I guess I meant to use g_stat, but forgot. Or perhaps because the code already used stat.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2008-11-13 16:03:45 UTC
I would say also using g_stat() in the other places would be good. But otherwise this looks good. Simon, could you update the patch?
Comment 6 Simon Holm Thøgersen 2008-11-24 02:52:52 UTC
Created attachment 123299 [details] [review]
registry: reduce the number of stat calls for each plugin from 3 to 1.

Updates the patch to use g_stat() instead of stat() as suggested by Stefan Kost.
Comment 7 Sebastian Dröge (slomo) 2008-11-24 09:58:49 UTC
2008-11-24  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

        Patch by: Simon Holm Thøgersen <odie at cs dot aau dot dk>

        * gst/gstregistry.c: (gst_registry_scan_path_level):
        Reduce the number of stat() calls for every file from three times
        to one time. Fixes bug #560360.