Skip to content

Commit

Permalink
Use CLoader for improved YAML parsing speed.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
roehling committed Feb 12, 2013
1 parent 8ee4998 commit 89a6848
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rosdep2/sources_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 89a6848

Please sign in to comment.