diff --git a/inginious/common/custom_yaml.py b/inginious/common/custom_yaml.py
index <HASH>..<HASH> 100644
--- a/inginious/common/custom_yaml.py
+++ b/inginious/common/custom_yaml.py
@@ -21,7 +21,11 @@
 from collections import OrderedDict
 
 import yaml as original_yaml
-
+try:
+    from yaml import CSafeLoader as SafeLoader
+    from yaml import CSafeDumper as SafeDumper
+except ImportError:
+    from yaml import SafeLoader, SafeDumper
 
 def load(stream):
     """
@@ -32,7 +36,7 @@ def load(stream):
         Safe version.
     """
 
-    class OrderedLoader(original_yaml.SafeLoader):
+    class OrderedLoader(SafeLoader):
         pass
 
     def construct_mapping(loader, node):
@@ -59,7 +63,7 @@ def dump(data, stream=None, **kwds):
     """
 
     # Display OrderedDicts correctly
-    class OrderedDumper(original_yaml.SafeDumper):
+    class OrderedDumper(SafeDumper):
         pass
 
     def _dict_representer(dumper, data):
Improve the speed of the YAML dumper/loader

...when LibYAML is installed on the system.



This hopefully fixes the problems with very long generation times of submissions archives.

(from 1h+ to less than a minute...)



TODO: update the doc to incite to install libyaml.