Skip to content

Comments

Add memory benchmark with valgrind massif#28

Closed
Copilot wants to merge 5 commits intomainfrom
copilot/add-benchmark-memory-usage
Closed

Add memory benchmark with valgrind massif#28
Copilot wants to merge 5 commits intomainfrom
copilot/add-benchmark-memory-usage

Conversation

Copy link
Contributor

Copilot AI commented Nov 23, 2025

Adds make benchmark-mem to profile ART memory overhead using valgrind massif, testing uniform and zipfian key distributions with nullptr values.

Implementation

  • bench/memory.cpp: Standalone executable accepting n_keys and distribution type (uniform|zipf)
  • Makefile: benchmark-mem target runs massif on 100k keys for both distributions, outputs reports
  • CMakeLists.txt: New bench-mem executable linked against art and zipf libraries

Usage

# Run default benchmarks (100k keys, both distributions)
make benchmark-mem

# Custom run
valgrind --tool=massif --massif-out-file=massif.out ./build/bench-mem 250000 zipf < /dev/null
ms_print massif.out

Massif output shows peak heap usage and allocation breakdown by ART node types (node_4, node_16, node_48, node_256).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>benchmark missing space / mem used</issue_title>
<issue_description>possible to include the benchmark of space / mem used?</issue_description>

Comments on the Issue (you are @copilot in this section)

@rafaelkallis hi @hiqsociety, would a `make benchmark-mem` command solve your needs? The command would run a file using [valgrind massif](https://valgrind.org/docs/manual/ms-manual.html). For the benchmark itself I would test two scenarios of interest: 1) uniformly distributed keys and 2) zipfian keys. I would fill the tree with `nullptr` values to only measure data structure overhead.

Would that solve your use case? Do you have any other parameter (dependent variable) wishes for the benchmark?</comment_new>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits November 23, 2025 17:58
- Created bench/memory.cpp with uniform and zipfian distribution benchmarks
- Added bench-mem executable to CMakeLists.txt
- Added benchmark-mem target to Makefile
- Uses nullptr values to measure only data structure overhead

Co-authored-by: rafaelkallis <9661903+rafaelkallis@users.noreply.github.com>
Co-authored-by: rafaelkallis <9661903+rafaelkallis@users.noreply.github.com>
- Add exception handling for invalid numeric arguments
- Extract zipfian distribution range as named constant
- Use cerr for error messages instead of cout

Co-authored-by: rafaelkallis <9661903+rafaelkallis@users.noreply.github.com>
Co-authored-by: rafaelkallis <9661903+rafaelkallis@users.noreply.github.com>
Copilot AI changed the title [WIP] Add benchmark for memory usage measurement Add memory benchmark with valgrind massif Nov 23, 2025
Copilot AI requested a review from rafaelkallis November 23, 2025 18:07
@rafaelkallis rafaelkallis deleted the copilot/add-benchmark-memory-usage branch November 24, 2025 08:08
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.

benchmark missing space / mem used

2 participants