UcasRichard / snakeyaml

Automatically exported from code.google.com/p/snakeyaml
Apache License 2.0
0 stars 0 forks source link

Context for error reporting consumes a lot of resources #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Support for informative error message in case of invalid YAML document requires 
a lot of resources at runtime.
Is it possible to simplify error messages but reduce amount of resources needed 
to parse a valid YAML document ?

Original issue reported on code.google.com by py4fun@gmail.com on 20 Aug 2010 at 10:19

GoogleCodeExporter commented 9 years ago
With the introduction of LoaderOptions it is now possible to specify deviations 
while parsing a YAML document. Since this context in a mark is very expensive 
(in both performance and memory) it is switched off by default. Line and column 
numbers are still present in the error message. To enable the context 
Mode.CONTEXT_MARK must be used
(http://code.google.com/p/snakeyaml/source/browse/src/test/java/org/yaml/snakeya
ml/LoaderTest.java)

Original comment by py4fun@gmail.com on 3 Sep 2010 at 1:23

GoogleCodeExporter commented 9 years ago
Use LoaderOptions.setWithMarkContext(true) to keep the context in Mark.

With this option on loader works 40% slower and it consumes much more memory 
but the error message provide more information about the error.

Original comment by py4fun@gmail.com on 6 Sep 2010 at 5:02

GoogleCodeExporter commented 9 years ago
Issue 101 has been merged into this issue.

Original comment by py4fun@gmail.com on 10 Jan 2011 at 1:54

GoogleCodeExporter commented 9 years ago
LoaderOptions.setWithMarkContext(true) has been removed in favor of more 
general approach with immutable data for Mark.

Original comment by py4fun@gmail.com on 31 Jan 2011 at 9:01