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

Resolve #1940: Refactor ThenKeyExpression#normalizeKeyForPositions for performance #1941

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Guava dependency version has been updated to 31.1. Projects may need to chec
// begin next release
### NEXT_RELEASE

* **Bug fix** Fix 1 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Refactor ThenKeyExpression#normalizeKeyForPositions to reduce hotspot detected by removing stream() implementation to reduce new object creation [(Issue #1940)](https://github.com/FoundationDB/fdb-record-layer/issues/1940)
* **Bug fix** Fix 2 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 3 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 4 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,11 @@ public <S extends KeyExpressionVisitor.State, R> R expand(@Nonnull final KeyExpr
@Nonnull
@Override
public List<KeyExpression> normalizeKeyForPositions() {
return getChildren()
.stream().flatMap(k -> k.normalizeKeyForPositions().stream())
.collect(Collectors.toList());
List<KeyExpression> list = new ArrayList<>();
for (KeyExpression k : getChildren()) {
list.addAll(k.normalizeKeyForPositions());
}
return list;
}

@Override
Expand Down