Skip to content

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

@karlwalsh

Description

@karlwalsh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions