info: fix performance issue with registering categories after gst_init()
authorTim-Philipp Müller <tim@centricular.com>
Sat, 2 Dec 2017 12:22:47 +0000 (12:22 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 2 Dec 2017 12:51:17 +0000 (12:51 +0000)
commit67e9d139504b942552c769791a0e7657e840d872
tree79fc78b7c229a4cf252111baa587a27ea1e60398
parent4bb5da9c2802ea5127452e985c29bd3ee2d90860
info: fix performance issue with registering categories after gst_init()

When registering a new debug category after gst_init(), simply check
the existing patterns against that new category.

No need to iterate over all categories and recheck them all against
the existing patterns.

Also, no need to re-parse the existing pattern string set via GST_DEBUG
and add the same set of match patterns all over again to the existing
list of match patterns every time we register a new debug category.

Combined with iterating all debug categories on a change this would
make adding debug categories after gst_init() very very very slow.
gst/gstinfo.c