From 89a6848cc8cc98e2e830b8b6072e73a68d78f9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Tue, 12 Feb 2013 14:43:58 +0100 Subject: [PATCH] Use CLoader for improved YAML parsing speed. The default YAML parser is very slow for large files. The CLoader takes advantage of an optimized C version and is significantly faster. Note that while this patch somewhat alleviates the pain with current rospack/rosdep performance, it is still noticeably slow. --- src/rosdep2/sources_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rosdep2/sources_list.py b/src/rosdep2/sources_list.py index 6ca6b3d192..6cc5b54049 100644 --- a/src/rosdep2/sources_list.py +++ b/src/rosdep2/sources_list.py @@ -145,7 +145,7 @@ def create_model(type_, uri, tags, origin=None): if verbose: print("loading cached data source:\n\t%s\n\t%s"%(uri, filepath), file=sys.stderr) with open(filepath) as f: - rosdep_data = yaml.load(f.read()) + rosdep_data = yaml.load(f.read(), Loader=yaml.CLoader) else: rosdep_data = {} return CachedDataSource(type_, uri, tags, rosdep_data, origin=filepath)