Custom Query (132 matches)


Show under each result:

Results (55 - 57 of 132)

Ticket Resolution Summary Owner Reporter
#12 fixed PyYAML is slow xi edemaine@…

Reported by edemaine@…, 8 years ago.


Here are two simple wall-clock timings comparing PyYAML to PySyck on a Pentium 4 2.8GHz with 1MB cache and 1GB RAM:

$ wc file1.yaml
 2036  8767 59154 file1
$ file1.yaml
0:00:00.001419 to read the YAML via Syck
0:00:04.029627 to read the YAML via PyYAML
$ wc file2.yaml
  8949  35105 317342 file2
$ file2.yaml
0:00:00.001564 to read the YAML via Syck
0:00:19.288912 to read the YAML via PyYAML

I do not expect PyYAML to be terribly competitive with Syck: the language barrier is big, and PyYAML is written with a higher level of abstraction. But I was surprised to see a factor of 12,000 difference. I wonder if a bit of profiling and tuning might reduce this gap to just a couple of orders of magnitude (100x) instead of four? Personally, 19 seconds to read a 0.3 meg file is too slow for my application, so I'll have to switch back to Syck for now, unfortunately. Just food for thought...

#82 worksforme PyYAML raises exception on empty files xi Miki Tebeka <miki.tebeka@…>

Reported by Miki Tebeka <miki.tebeka@…>, 6 years ago.

Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> fo = open("/dev/null")
>>> import yaml
>>> yaml.load(fo)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/yaml/", line 66, in load
    return loader.get_data()
  File "/usr/lib/python2.5/site-packages/yaml/", line 38, in get_data
    return self.construct_document(self.get_node())
  File "/usr/lib/python2.5/site-packages/yaml/", line 23, in get_node
    return self.compose_document()
  File "/usr/lib/python2.5/site-packages/yaml/", line 35, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib/python2.5/site-packages/yaml/", line 52, in compose_node
    anchor = event.anchor
AttributeError: 'NoneType' object has no attribute 'anchor'
#166 wontfix PyYAML should use libyaml if libyaml available xi sgwong

Reported by sgwong, 4 years ago.


Currently PyYAML only use python implementation although the libyaml available. The following simple changes on should do: (I'm not sure whats the use of __with_libyaml__)

__version__ = '3.09'

    from cyaml import *
    __with_libyaml__ = True
    Loader = CLoader
    Dumper = CDumper
except ImportError:
    __with_libyaml__ = False 
Note: See TracQuery for help on using queries.