-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
The Long getCommittedVersion() has an overhead of Autoboxing the primitive long value to a Long object. It's not clear to me the use case for this return value - the JavaDoc do not comment on what a 'null' value returned would indicate.
foundationdb/bindings/java/src/main/com/apple/foundationdb/Transaction.java
Lines 244 to 254 in 280b10f
| /** | |
| * Gets the version number at which a successful commit modified the database. | |
| * This must be called only after the successful (non-error) completion of a call | |
| * to {@link #commit()} on this {@code Transaction}, or the behavior is undefined. | |
| * Read-only transactions do not modify the database when committed and will have | |
| * a committed version of -1. Keep in mind that a transaction which reads keys and | |
| * then sets them to their current values may be optimized to a read-only transaction. | |
| * | |
| * @return the database version at which the commit succeeded | |
| */ | |
| Long getCommittedVersion(); |
It looks like the source for this data is primitive already:
| return Transaction_getCommittedVersion(getPtr()); |
Please consider adding a new method with a primitive return type to avoid this overhead.
I happened to come across this when reviewing an application that had churned 9GB of Long values in heap in ~30min - certainly not the end of the world, but something to flag. Thanks.
Metadata
Metadata
Assignees
Labels
No labels