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

Large number of appends for a single key is very slow to resolve #813

Open
karlwalsh opened this issue Jan 23, 2025 · 0 comments
Open

Large number of appends for a single key is very slow to resolve #813

karlwalsh opened this issue Jan 23, 2025 · 0 comments

Comments

@karlwalsh
Copy link

karlwalsh commented Jan 23, 2025

Hey there, this is probably a niche issue as I can't see it reported anywhere but I'm seeing significant slowdown when resolving config with a large number of appends for a single key, e.g.

ConfigFactory.parseString("""
  key += "0"
  key += "1"
  ...
  key += "n"
""").resolve()

If n <= 100 it takes ~400ms on my machine, ~2 seconds for n = 200, and ~10 seconds for n = 300.

If n is 500 I get a stack overflow exception

This is obviously a simplified example, but my actual usecase is to load many config files from the classpath where each may contribute several or more values to the key.

Also, if those 300 appends are split across three config files, e.g. a.conf defines key += "0" .. key += "99", and b.conf appends 100..199, and c.conf appends 200..299, the slowdown is even more pronounced, about 50 seconds on my machine.

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

1 participant