Skip to content

Performance Regression in v0.3.6 with LazyNode Usage #46

@s-fuerst

Description

@s-fuerst

I’ve encountered a severe performance regression in version v0.3.6 when using LazyNode.

Example code:

using XML
using CodecZlib

stream = GzipDecompressorStream(open("berlin-v5.5.3-1pct.output_plans.xml.gz"))

pos = read(stream, LazyNode)

function next_tag(pos, search)
    pos = next(pos)
    while tag(pos) != search
        pos = next(pos)
        if pos === nothing
            return nothing
        end
    end
    pos
end

next_tag(pos, "person")

@time next_tag(pos, "person")

The test file can be downloaded from:
https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v5.5-1pct/output-berlin-v5.5-1pct/berlin-v5.5.3-1pct.output_plans.xml.gz

Results:

  • v0.3.5: next_tag executes in ~4 µs
  • v0.3.6: The same call takes ~8 seconds — around 2 million times slower.

This issue occurs both with compressed (gzip) and uncompressed streams.

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