Possible performance regression when parsing large text values?

90 views
Skip to first unread message

Tanguy Leroux

unread,
Oct 31, 2017, 10:49:37 AM10/31/17
to SnakeYAML
Hi all,

I tried a Jackson 2.8.6 to 2.9.2 update recently and I've been surprised by the
slow performance when parsing YAML files. Jackson 2.9.2 depends on
Snakeyaml 1.18 so I tried with Jackson 2.9.2 and Snakeyaml 1.17 and the
performance were good again.

The change appears when parsing a large text value (+200K chars) and I'm
 wondering if the following change could be the cause:

https://bitbucket.org/asomov/snakeyaml/commits/2057e78650b9d9d6e459255135d8442303635dad#Lsrc/main/java/org/yaml/snakeyaml/reader/StreamReader.javaT158

Does anyone also have bad performance between 1.17 and 1.18?

Thanks

--
Tanguy

maslovalex

unread,
Dec 23, 2017, 10:07:03 AM12/23/17
to SnakeYAML
Latest commit should put performance back to the same level as 1.17 ( https://bitbucket.org/asomov/snakeyaml/commits/e77671f0ca881db53c1b31a82693f6cc53658afe )

Thx for bringing this up.

-Alex

maslovalex

unread,
Dec 25, 2017, 6:13:19 PM12/25/17
to SnakeYAML
Actually it is not, unfortunately. (looked at wrong numbers first).

-Alex

tlrx

unread,
Jan 2, 2018, 4:06:50 AM1/2/18
to snakeya...@googlegroups.com
Awesome, Thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "SnakeYAML" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/snakeyaml-core/y8bKgDdZwuQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to snakeyaml-core+unsubscribe@googlegroups.com.
To post to this group, send email to snakeyaml-core@googlegroups.com.
Visit this group at https://groups.google.com/group/snakeyaml-core.
For more options, visit https://groups.google.com/d/optout.

maslovalex

unread,
Jan 2, 2018, 4:16:30 AM1/2/18
to SnakeYAML
As I said: Not sure it helped.
I don't have a good test case for this. Let's see if we can improve in this field.

-Alex


On Tuesday, January 2, 2018 at 11:06:50 AM UTC+2, tlrx wrote:
Awesome, Thanks!

2017-12-23 16:07 GMT+01:00 maslovalex <alexande...@gmail.com>:
Latest commit should put performance back to the same level as 1.17 ( https://bitbucket.org/asomov/snakeyaml/commits/e77671f0ca881db53c1b31a82693f6cc53658afe )

Thx for bringing this up.

-Alex

On Tuesday, October 31, 2017 at 4:49:37 PM UTC+2, Tanguy Leroux wrote:
Hi all,

I tried a Jackson 2.8.6 to 2.9.2 update recently and I've been surprised by the
slow performance when parsing YAML files. Jackson 2.9.2 depends on
Snakeyaml 1.18 so I tried with Jackson 2.9.2 and Snakeyaml 1.17 and the
performance were good again.

The change appears when parsing a large text value (+200K chars) and I'm
 wondering if the following change could be the cause:

https://bitbucket.org/asomov/snakeyaml/commits/2057e78650b9d9d6e459255135d8442303635dad#Lsrc/main/java/org/yaml/snakeyaml/reader/StreamReader.javaT158

Does anyone also have bad performance between 1.17 and 1.18?

Thanks

--
Tanguy

--
You received this message because you are subscribed to a topic in the Google Groups "SnakeYAML" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/snakeyaml-core/y8bKgDdZwuQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to snakeyaml-cor...@googlegroups.com.
To post to this group, send email to snakeya...@googlegroups.com.

Tanguy Leroux

unread,
Feb 2, 2018, 6:33:36 AM2/2/18
to SnakeYAML
Hi,

I spent some time today testing both 1.19 and 1.20-SNAPSHOT (09b3c58) versions and
I can confirm that the performance are worse in our use case than with version 1.17.

We use snakeyaml through the Jackson library to parse large base64 encoded text in our
tests. The test that helps us to spot the performance issue in 1.18 is [1].

It's a REST API test that is parsed using jackson+snakeyaml in order to test HTTP requests.
It's possible that a simple unit test that parses a large text value would spot the performance
regression too. I'm a bit concerned as all our REST tests (and there are a lot!) are based on
YAML, and this regression could potentially affect all the performance of the execution of the
test suite.

It seems that the modified portion of the code is used whenever a string value is parsed, am
I right?

Thanks,

-- Tanguy

[1] https://raw.githubusercontent.com/elastic/elasticsearch/master/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml
Reply all
Reply to author
Forward
0 new messages