Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@roberto-bayardo
Copy link
Collaborator

Since there's no need to maintain a fixed length, use of varint should in general save space.

@roberto-bayardo roberto-bayardo marked this pull request as ready for review August 21, 2025 16:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR changes variable stores to use varint encoding for uint64 values in commit floor operations, replacing fixed-length encoding to save space when storing smaller values.

  • Replaces u64 with UInt<u64> wrapper for commit floor operations
  • Updates serialization/deserialization to use varint encoding instead of fixed-length bytes
  • Modifies display formatting to handle the wrapped type

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
storage/src/store/operation.rs Changes CommitFloor variant to use UInt<u64> wrapper and updates encoding/decoding logic
storage/src/store/mod.rs Updates code to wrap u64 values in UInt when creating CommitFloor operations
storage/src/adb/any/variable/mod.rs Updates code to wrap u64 values in UInt when creating CommitFloor operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

BrendanChou
BrendanChou previously approved these changes Aug 21, 2025
BrendanChou
BrendanChou previously approved these changes Aug 21, 2025
COMMIT_FLOOR_CONTEXT => {
let floor_loc = u64::read(buf)?;
Ok(Self::CommitFloor(floor_loc))
let floor_loc = UInt::<u64>::read(buf)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can infer the type here:

let round = UInt::read(buf)?.into();

You should just be able to do Uint::read(buf)?.into();

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

match &self {
Fixed::Delete(k) => {
buf.put_u8(DELETE_CONTEXT);
DELETE_CONTEXT.write(buf);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@patrick-ogrady patrick-ogrady merged commit 301b331 into main Aug 21, 2025
16 of 19 checks passed
@patrick-ogrady patrick-ogrady deleted the varint-commit branch August 21, 2025 17:09
@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.73%. Comparing base (314a104) to head (57fcb82).
⚠️ Report is 3 commits behind head on main.

@@           Coverage Diff           @@
##             main    #1449   +/-   ##
=======================================
  Coverage   91.73%   91.73%           
=======================================
  Files         276      276           
  Lines       69729    69729           
=======================================
  Hits        63968    63968           
  Misses       5761     5761           
Files with missing lines Coverage Δ
storage/src/store/operation.rs 89.70% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd795b5...57fcb82. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants