Skip to content

Deep dive performance impact of 1.11.8 PatchPoint handling change #1095

@tgregg

Description

@tgregg

While investigating other performance concerns, I found that 1.11.8 introduced a regression to writing in certain circumstances. Related change: #521

Dataset: deeply nested single value

Benchmarking code: ion-java-benchmark-cli, modified so that the read command tests IonWriter.writeValues(IonReader) with stream copy optimization disabled. I will formally add an option to the tool that does this in a separate PR.

CLI command: ./benchmark-cli read --mode AverageTime --time-unit microseconds --iterations 2 --warmups 2 --forks 2 --ion-reader non_incremental --io-type buffer <file>

1.11.5
Time: 42.918 us/op
Allocation rate: 26 KB/op

1.11.8 (another regression happened here, related to the change to how PatchPoints are handled. This will be addressed separately)
Time: 44.937 us/op
Allocation rate: 32 KB/op

Based on the increase in allocation rate I tried tuning the initial size of the PatchPoint recycling queue for this dataset. I achieved best performance at size 64 (down from 512), which closed the allocation rate gap but still left a performance gap. Based on CPU profiles, I suspect that the change negatively impacted the optimizations the JIT can make. Optimization that worked in a similar situation: #1094

We should spend some time investigating and experimenting with this. Achieving the same performance as 1.11.5 should be possible.

NOTE: #521 demonstrated positive performance impact for some datasets, so we need to be careful not to optimize for some at the expense of others.

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