Skip to content

perf: Optimise Bolt values unpacking #1629

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

Merged
merged 3 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ venv
testkit-backend/bin/
testkit/CAs/
testkit/CustomCAs/
bolt-connection
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
package org.neo4j.driver.internal.value;

import java.time.DateTimeException;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.OffsetDateTime;
import java.time.OffsetTime;
import java.time.Period;
import java.time.ZonedDateTime;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -47,6 +55,96 @@ public Value value(Object value) {
return ((InternalValue) Values.value(value)).asBoltValue();
}

@Override
public Value value(boolean value) {
return ((InternalValue) Values.value(value)).asBoltValue();
}

@Override
public Value value(long value) {
return ((InternalValue) Values.value(value)).asBoltValue();
}

@Override
public Value value(double value) {
return ((InternalValue) Values.value(value)).asBoltValue();
}

@Override
public Value value(byte[] values) {
return ((InternalValue) Values.value(values)).asBoltValue();
}

@Override
public Value value(String value) {
return ((InternalValue) Values.value(value)).asBoltValue();
}

@Override
public Value value(Map<String, Value> stringToValue) {
return ((InternalValue) Values.value(stringToValue)).asBoltValue();
}

@Override
public Value value(Value[] values) {
return ((InternalValue) Values.value(values)).asBoltValue();
}

@Override
public Value value(Node node) {
return ((InternalValue) Values.value(node)).asBoltValue();
}

@Override
public Value value(Relationship relationship) {
return ((InternalValue) Values.value(relationship)).asBoltValue();
}

@Override
public Value value(Path path) {
return ((InternalValue) Values.value(path)).asBoltValue();
}

@Override
public Value value(LocalDate localDate) {
return ((InternalValue) Values.value(localDate)).asBoltValue();
}

@Override
public Value value(OffsetTime offsetTime) {
return ((InternalValue) Values.value(offsetTime)).asBoltValue();
}

@Override
public Value value(LocalTime localTime) {
return ((InternalValue) Values.value(localTime)).asBoltValue();
}

@Override
public Value value(LocalDateTime localDateTime) {
return ((InternalValue) Values.value(localDateTime)).asBoltValue();
}

@Override
public Value value(OffsetDateTime offsetDateTime) {
return ((InternalValue) Values.value(offsetDateTime)).asBoltValue();
}

@Override
public Value value(ZonedDateTime zonedDateTime) {
return ((InternalValue) Values.value(zonedDateTime)).asBoltValue();
}

@Override
public Value value(Period period) {
return ((InternalValue) Values.value(period)).asBoltValue();
}

@Override
public Value value(Duration duration) {
return ((InternalValue) Values.value(duration)).asBoltValue();
}

@Override
public Node node(long id, String elementId, Collection<String> labels, Map<String, Value> properties) {
return new InternalNode(id, elementId, labels, toDriverMap(properties));
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<maven.deploy.skip>true</maven.deploy.skip>

<!-- Versions -->
<neo4j-bolt-connection-bom.version>1.0.0</neo4j-bolt-connection-bom.version>
<neo4j-bolt-connection-bom.version>1.1.0</neo4j-bolt-connection-bom.version>
<reactive-streams.version>1.0.4</reactive-streams.version>
<!-- Please note that when updating this dependency -->
<!-- (i.e. due to a security vulnerability or bug) that the -->
Expand Down