Skip to content

Conversation

@MarkWolters
Copy link
Contributor

@MarkWolters MarkWolters commented Dec 5, 2025

This PR adds new columns to the BenchYAML tests measuring memory and disk usage. The output looks as follows:

Configuration:
  efConstruction        : 100
  addHierarchy          : true
  neighborOverflow      : 1.2
  usePruning            : true
  M                     : 32

Overquery    Avg QPS (of 3)    ± Std Dev    CV %        Mean Latency (ms)    Avg Visited    Recall@10    Max heap usage    Max offheap usage    Total file size    Number of files    Index build time   
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.00         45799.0           706.6        1.5         0.192                349.6          0.75         1127.6            116.5                116.5              1                  38.72              
2.00         38702.6           344.8        0.9         0.237                507.2          0.89         494.1             116.5                116.5              1                  38.72              
5.00         25087.6           463.2        1.8         0.363                922.1          0.95         795.4             116.5                116.5              1                  38.72              
10.00        16557.8           45.5         0.3         0.551                1512.0         0.97         1219.3            116.5                116.5              1                  38.72         

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Before you submit for review:

  • Does your PR follow guidelines from CONTRIBUTIONS.md?
  • Did you summarize what this PR does clearly and concisely?
  • Did you include performance data for changes which may be performance impacting?
  • Did you include useful docs for any user-facing changes or features?
  • Did you include useful javadocs for developer oriented changes, explaining new concepts or key changes?
  • Did you trigger and review regression testing results against the base branch via Run Bench Main?
  • Did you adhere to the code formatting guidelines (TBD)
  • Did you group your changes for easy review, providing meaningful descriptions for each commit?
  • Did you ensure that all files contain the correct copyright header?

If you did not complete any of these, then please explain below.

@MarkWolters MarkWolters marked this pull request as ready for review December 9, 2025 00:54
* Get the index build time for a dataset
*/
public static Double getIndexBuildTime(String datasetName) {
return indexBuildTimes.get(datasetName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps clarify the unit here, such as getIndexBuildTimeMillis or getIndexBuildTimeSeconds

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, I will add that.

{
// Capture initial memory and disk state
var diagnostics = new io.github.jbellis.jvector.example.benchmarks.diagnostics.BenchmarkDiagnostics(getDiagnosticLevel());
diagnostics.setMonitoredDirectory(testDirectory);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does import not work for this symbol?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not recall why this is fully qualified but I will clean it up


if (!snapshots.isEmpty()) {
if (!snapshots.isEmpty() && level != DiagnosticLevel.NONE) {
SystemMonitor.SystemSnapshot preSnapshot = snapshots.get(snapshots.size() - 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an idea for an improvement, DiagnosticLevel could control both snapshot collection and then iterate through the snapshots, even if there are zero. Just a simplification possibly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, will look into it

* Utility class for monitoring disk usage during benchmark execution.
* Tracks total disk space used and number of files created.
*/
public class DiskUsageMonitor {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would strongly suggest using the notify mechanism that allows you to see update events within the filesystem, to avoid traversing things fully every time you want a read. Then you could easily keep a current view that only processes deltas for changes as they occur. This would possibly move some FS IO out of the measured bucket so that IO measurements are less perturbed by infra code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, this is great feedback. I'll hold off on this PR until I get that in place

Copy link
Contributor

@jshook jshook left a comment

Choose a reason for hiding this comment

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

I've approved this, but please see my comments regarding notify. I think you might have a better way to implement this which is well supported and much more efficient.

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.

3 participants