# Ansible startup performance & time spent loading in ConfigManager

**URL:** <https://forum.ansible.com/t/ansible-startup-performance-time-spent-loading-in-configmanager/26356>\
**Category:** Ansible Developer\
**Created:** [December 21, 2017, 5:08am UTC](https://forum.ansible.com/t/ansible-startup-performance-time-spent-loading-in-configmanager/26356 "2017-12-21T05:08:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hercules888](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@hercules888](https://forum.ansible.com/u/hercules888)\
**Post date:** [December 21, 2017, 5:08am UTC](https://forum.ansible.com/t/ansible-startup-performance-time-spent-loading-in-configmanager/26356/1 "2017-12-21T05:08:00Z")

</div>

Hi all,

I’m using ansible to deploy my home lab. It’s running CentOS 7.4 AArch on a pine64 board,  
so it has a slow ARM cpu. Executing ansible is slow (10 sec without any playbook),  
and I started to look where time got spent.  
More than half of this time is lost parsing the base config yaml (ansible/config/base.yml).  
I patched ansible/config/manager.py, and added  
yaml.SafeLoader = yaml.CSafeLoader  
before  
yaml.safe\_load(config\_def)  
is invoked.  
This brought startup time to one third of the initial time.

I checked pyyaml if CSafeLoader can be forced as a default one way or another,  
and after a quick check, I didn’t find a possibility to set a default loader (except with extra parameter)  
([https://github.com/yaml/pyyaml/blob/master/lib/yaml/\_\_init\_\_.py](https://github.com/yaml/pyyaml/blob/master/lib/yaml/ __init__.py))

Is it possible to have the CSafeLoader as the default behaviour when running ansible?  
Or have I overlooked something, and should this be resolved differently?

Thank you very much for any feedback!

---

<div class="post-metadata">

**Author:** ![tkuratom](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Post date:** [December 21, 2017, 2:37pm UTC](https://forum.ansible.com/t/ansible-startup-performance-time-spent-loading-in-configmanager/26356/2 "2017-12-21T14:37:50Z")

</div>

This is a good idea. For parsing playbooks we made this change a long time ago. Could you open a bug report on GitHub for this? With the holiday vacation coming up, I don’t want this to be forgotten.

Thanks,  
-Toshio

---

<div class="post-metadata">

**Author:** ![hercules888](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@hercules888](https://forum.ansible.com/u/hercules888)\
**Post date:** [December 21, 2017, 3:34pm UTC](https://forum.ansible.com/t/ansible-startup-performance-time-spent-loading-in-configmanager/26356/3 "2017-12-21T15:34:52Z")

</div>

Thanks for your feedback. Issue has been created \> [https://github.com/ansible/ansible/issues/34147](https://github.com/ansible/ansible/issues/34147)
