|
From: Anders K. <an...@MI...> - 2009-04-22 03:13:56
|
On Wed, 22 Apr 2009, jn...@gm... wrote: > What bothers me is that there's a negligible difference in speed, even > with libyaml installed, and pyyaml using the cyaml extension: Are you sure that pyyaml is using the cyaml extension? You need to explicitly tell it to do so: - j = yaml.dump(raw) - yaml.load(j) + j = yaml.dump(raw, Dumper=yaml.CDumper) + yaml.load(j, Loader=yaml.CLoader) After such changes, I see a ~4x speedup. before: ser_yaml (6.870s) 623178 bytes ser_yaml_compressed (6.930s) 291042 bytes serde_yaml (19.660s) after: ser_yaml (2.120s) 623533 bytes ser_yaml_compressed (2.150s) 291208 bytes serde_yaml (5.100s) Anders |