From: Stefan K. <en...@ho...> - 2007-11-09 16:34:37
|
Hi, Quoting Tim M=FCller <t....@ze...>: > On Tue, 2007-11-06 at 21:46 +0200, Stefan Kost wrote: > >> > * gst/gstdebugutils.c: (debug_dump_element), >> > (_gst_debug_bin_to_dot_file), (_gst_debug_bin_to_dot_file_with_ts): >> > Don't use VLAs which is a C99ism and throws off MSVC (#493983). >> >> Wouldn't that be a use case of g_alloca ? > > g_alloca() would have been a possibility too, yes. But since the patch > provided used g_malloc() and I personally have a strong dislike against > g_alloca() and we don't use it anywhere else in the core, I did not > change it. > We were using it a.g. in alsa. And we should us it more. GStreamer =20 causes quite a lot of memory fragmentation. I can rewrite this to do =20 better in the next cycle. > >> * gst/gst.c: (_gst_disable_segtrap): >> Make _gst_disable_segtrap static, it's only used in gstplugin.c and >> we can use gst_segtrap_is_enabled() there now that we have that API. >> Move _gst_debug_dump_dot_dir into gstdebugutils.c, there's no reason >> to do the getenv here (and export the variable). >> >> Hmm, I don't think we want to call getenv each time we dump a graph? > > Each time we dump a graph, we iterate through all elements and pads of a > bin or pipeline, take and release hundreds of locks in the process, do a > trizillion mallocs/frees/printfs, and WRITE TO DISK. I fail to believe > that a single call to getenv() before all that is going to have a > significant performance impact. If you have any evidence to the > contrary, I'd love to see it :) Its about when the env-var is *not* set. Then we just want to return =20 quickly. Imaging having this in state_changed for each element. So =20 instead of const gchar *dump_dot_dir; dump_dot_dir =3D g_getenv ("GST_DEBUG_DUMP_DOT_DIR"); if (!dump_dot_dir) return; what about static gboolean tested_dump_dot_dir =3D FALSE; static const gchar *dump_dot_dir =3D NULL; if( !tested_dump_dot_dir) { dump_dot_dir =3D g_getenv ("GST_DEBUG_DUMP_DOT_DIR"); tested_dump_dot_dir =3D TRUE; } if (!dump_dot_dir) return; Stefan > > Cheers > -Tim > > PS: so what's next, a debate on the performance impact of ++i vs. i++? > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > gstreamer-devel mailing list > gst...@li... > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel > |