Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hocon.load takes exponential time to load with += seperator #89

Open
musiaht opened this issue Oct 20, 2016 · 2 comments
Open

Hocon.load takes exponential time to load with += seperator #89

musiaht opened this issue Oct 20, 2016 · 2 comments

Comments

@musiaht
Copy link

musiaht commented Oct 20, 2016

Encountering a problem with Hocon.load and Hocon.ConfigFactory.load_file; when loading a file with more than 5 '+=' to a key it will take exponentially longer with each concatenation.

For example, a file with the following will take more than 30 minutes to load.

asdf.s += 'asdf'
asdf.s += 'asdf.asd.asd.afs.asf.a.sf.asf.asf.asf.a.sf.'
asdf.s += 'asdf.qwe.qwe.q.we.qwe.qw'
asdf.s += 'asdf.q.weqwe.qwe.qwe.'
asdf.s += 'asdf.qweq.weq.e.qwe.'
asdf.s += 'asdfqeqweqwe.qwe'
asdf.s += 'asdf.asfd.asf.af'
asdf.s += 'asd.asdfasff'
asdf.s += 'asdf.asdfsadf'
asdf.s += 'asd.aaaaaf'
asdf.s += 'asd.fdsgwer.f'
asdf.s += 'asdf.lkjp.poiu.zsdf'
asdf.s += 'asdf.erwerwer.werwer'
asdf.s += 'asdf.llfllwelpwelr.sdf'
asdf.s += 'asdf.asdfasdf'
asdf.s += 'asdf.sdfsdfppowerwer'
asdf.s += 'asdf.ggggg'

It looks like we can get away with converting that into an array, but I am wondering if this can be fixed?

@cprice404
Copy link

@musiaht thanks for the info. A couple of suggestions that might make it more likely that we can spend some time looking into it:

  1. Would you mind filing an issue for this on our Jira issue tracker? Issues there tend to get a little more visibility. Apologies that we don't have a link to that in the README here, we'll get that added.
  2. It would be helpful to know if this performance issue also exists in the upstream Java library. For the most part this library is a direct port of that code, so if we know the perf issue is not present there then we could look to see if there's something different about our implementation.

@musiaht
Copy link
Author

musiaht commented Oct 20, 2016

Thanks @cprice404,

I have filed the issue at https://tickets.puppetlabs.com/browse/HC-96.

I haven't taken a detailed look at the Java upstream library; but from what I've seen with the Play! framework (https://www.playframework.com/) it doesn't look like it does. I am assuming that the same Java library is used as they're both typesafe projects.

Common configurations would load modules against the 'play.modules.enabled' variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants