Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9dcc4f6
Apply X axis label
Chessray Dec 18, 2025
a676dfa
Filter for interesting lines more consistently
Chessray Dec 19, 2025
ec0e618
Allow for more than 10 colors in the resulting graphs
Chessray Dec 19, 2025
7c8096a
Allow for more than 10 colors in the resulting graphs
Chessray Dec 19, 2025
436b1b2
Plot with HW specs and legend outside graph.
Chessray Dec 29, 2025
ac65e0d
Ensure legend isn't cropped.
Chessray Dec 29, 2025
b8d829e
Add Kernel information to title
Chessray Dec 29, 2025
e384eda
Matplotlib has renamed the parameter 'b' to 'visible'.
Chessray Dec 30, 2025
6d2fccf
POC for Get with FFP
Chessray Jan 2, 2026
f8bb157
POC for Get with FFP
Chessray Jan 2, 2026
5ae29a9
POC for Get with FFP
Chessray Jan 2, 2026
1fbe4fd
POC for Get with FFP
Chessray Jan 2, 2026
7519228
POC for Get with FFP
Chessray Jan 2, 2026
a351ff8
POC for Get with FFP
Chessray Jan 2, 2026
e2ba86b
POC for Get with FFP
Chessray Jan 2, 2026
ae271de
POC for Get with FFP
Chessray Jan 2, 2026
c659997
POC for Get with FFP
Chessray Jan 2, 2026
8dc796f
POC for Get with FFP
Chessray Jan 2, 2026
255b170
POC for Get with FFP
Chessray Jan 2, 2026
6f28528
POC for Get with FFP
Chessray Jan 2, 2026
9802d02
POC for Get with FFP
Chessray Jan 2, 2026
6f0e8b4
Add subselection information to graph titles.
Chessray Jan 5, 2026
7e033d5
Extract System information into title
Chessray Jan 5, 2026
d5b1e58
Read system information during jmhrun in order to ensure that running…
Chessray Jan 5, 2026
dcb5c47
Put quotes around subselection in order to reduce confusion when usin…
Chessray Jan 5, 2026
85877b9
Add MemorySegment function to "Put" benchmark.
Chessray Jan 5, 2026
b54e147
Explicitly list value size
Chessray Jan 5, 2026
70df923
Explicitly list value size
Chessray Jan 5, 2026
aab6072
Explicitly list value size
Chessray Jan 5, 2026
e70a441
Provide Java 21 versions for all run configs.
Chessray Jan 6, 2026
1d92ce6
Provide Java 21 versions for all run configs.
Chessray Jan 6, 2026
279e60c
Add some marks to x axis.
Chessray Jan 7, 2026
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
19 changes: 19 additions & 0 deletions jmh_full_get_java21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"benchmark": "GetJNIBenchmark",
"jvmargs": ["Xmx4G", "XX:ErrorFile=./results/hs_err_pid%p.log", "XX:+HeapDumpOnOutOfMemoryError", "-enable-preview"],
"params": {
"valueSize": [10, 50, 512, 1024, 4096, 8192, 16384, 32768, 65536],
"cacheMB": [1],
"checksum": ["none", "copyout"]
},
"options": {
"batchsize": 1,
"warmupiterations": 20,
"warmuptime": "50ms",
"iterations": 50,
"time": "500ms"
},
"result.path": "./results",
"java.library.path": "target/jni-benchmarks-1.0.1-SNAPSHOT-application/jni-benchmarks-1.0.1-SNAPSHOT/lib",
"jar": "target/jni-benchmarks-1.0.1-SNAPSHOT-benchmarks.nar"
}
19 changes: 19 additions & 0 deletions jmh_full_put_java21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"benchmark": "PutJNIBenchmark",
"jvmargs": ["Xmx4G", "XX:ErrorFile=./results/hs_err_pid%p.log", "XX:+HeapDumpOnOutOfMemoryError", "-enable-preview"],
"params": {
"valueSize": [10, 50, 512, 1024, 4096, 8192, 16384, 32768, 65536],
"cacheMB": [1],
"checksum": ["none", "copyin"]
},
"options": {
"batchsize": 1,
"warmupiterations": 20,
"warmuptime": "50ms",
"iterations": 50,
"time": "500ms"
},
"result.path": "./results",
"java.library.path": "target/jni-benchmarks-1.0.1-SNAPSHOT-application/jni-benchmarks-1.0.1-SNAPSHOT/lib",
"jar": "target/jni-benchmarks-1.0.1-SNAPSHOT-benchmarks.nar"
}
14 changes: 9 additions & 5 deletions jmh_plot.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
"name": "valueSize",
"min": 1024
},
"label": "allbig"
"label": "allbig",
"valueSizeTitle": ">= 1024"
},
{
"xaxisparam": {
"name": "valueSize",
"min": 1,
"max": 4096
},
"label": "allsmall"
"label": "allsmall",
"valueSizeTitle": "<= 4096"
# defaults to include_patterns of all matching
},
{
Expand All @@ -23,15 +25,17 @@
"max": 4096
},
"exclude_patterns": ["Pooled"],
"label": "nopoolsmall"
"label": "nopoolsmall",
"valueSizeTitle": "<= 4096"
},
{
"xaxisparam": {
"name": "valueSize",
"min": 1024
},
"exclude_patterns": ["Pooled"],
"label": "nopoolbig"
"label": "nopoolbig",
"valueSizeTitle": ">= 1024"
},
{
"xaxisparam": {
Expand Down Expand Up @@ -84,4 +88,4 @@
}
],
"result.path": "./analysis/testplots"
}
}
19 changes: 19 additions & 0 deletions jmh_small_get_java21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"benchmark": "GetJNIBenchmark",
"jvmargs": ["Xmx4G", "XX:ErrorFile=./results/hs_err_pid%p.log", "XX:+HeapDumpOnOutOfMemoryError", "-enable-preview"],
"params": {
"valueSize": [10, 50, 512, 1024, 4096, 8192, 16384, 32768, 65536],
"cacheMB": [1],
"checksum": ["none", "copyout"]
},
"options": {
"batchsize": 1,
"warmupiterations": 10,
"warmuptime": "20ms",
"iterations": 20,
"time": "200ms"
},
"result.path": "./results",
"java.library.path": "target/jni-benchmarks-1.0.1-SNAPSHOT-application/jni-benchmarks-1.0.1-SNAPSHOT/lib",
"jar": "target/jni-benchmarks-1.0.1-SNAPSHOT-benchmarks.nar"
}
19 changes: 19 additions & 0 deletions jmh_small_put_java21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"benchmark": "PutJNIBenchmark",
"jvmargs": ["Xmx4G", "XX:ErrorFile=./results/hs_err_pid%p.log", "XX:+HeapDumpOnOutOfMemoryError", "-enable-preview"],
"params": {
"valueSize": [10, 50, 512, 1024, 4096, 8192, 16384, 32768, 65536],
"cacheMB": [1],
"checksum": ["none", "copyin"]
},
"options": {
"batchsize": 1,
"warmupiterations": 5,
"warmuptime": "20ms",
"iterations": 10,
"time": "100ms"
},
"result.path": "./results",
"java.library.path": "target/jni-benchmarks-1.0.1-SNAPSHOT-application/jni-benchmarks-1.0.1-SNAPSHOT/lib",
"jar": "target/jni-benchmarks-1.0.1-SNAPSHOT-benchmarks.nar"
}
19 changes: 19 additions & 0 deletions jmh_tiny_get_java21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"benchmark": "GetJNIBenchmark",
"jvmargs": ["Xmx4G", "XX:ErrorFile=./results/hs_err_pid%p.log", "XX:+HeapDumpOnOutOfMemoryError", "-enable-preview"],
"params": {
"valueSize": [50, 1024, 4096, 16384],
"cacheMB": [1],
"checksum": ["none", "copyout"]
},
"options": {
"batchsize": 1,
"warmupiterations": 5,
"warmuptime": "10ms",
"iterations": 5,
"time": "50ms"
},
"result.path": "./results",
"java.library.path": "target/jni-benchmarks-1.0.1-SNAPSHOT-application/jni-benchmarks-1.0.1-SNAPSHOT/lib",
"jar": "target/jni-benchmarks-1.0.1-SNAPSHOT-benchmarks.nar"
}
19 changes: 19 additions & 0 deletions jmh_tiny_put_java21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"benchmark": "PutJNIBenchmark",
"jvmargs": ["Xmx4G", "XX:ErrorFile=./results/hs_err_pid%p.log", "XX:+HeapDumpOnOutOfMemoryError", "-enable-preview"],
"params": {
"valueSize": [50, 1024, 4096, 16384],
"cacheMB": [1],
"checksum": ["none", "copyin"]
},
"options": {
"batchsize": 1,
"warmupiterations": 5,
"warmuptime": "10ms",
"iterations": 5,
"time": "50ms"
},
"result.path": "./results",
"java.library.path": "target/jni-benchmarks-1.0.1-SNAPSHOT-application/jni-benchmarks-1.0.1-SNAPSHOT/lib",
"jar": "target/jni-benchmarks-1.0.1-SNAPSHOT-benchmarks.nar"
}
80 changes: 63 additions & 17 deletions jmhplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import pandas as pd
from pandas.core.frame import DataFrame
import re
Expand Down Expand Up @@ -116,8 +117,8 @@ def normalize_data_frame_from_path(path: pathlib.Path):
except pd.errors.EmptyDataError:
break

# every 9th line is the interesting one, discard the rest
df = df.iloc[::9, :]
# df = df.iloc[::9, :]
df = df[~df['Benchmark'].str.contains(':')]
df["Benchmark"] = df["Benchmark"].apply(lambda x: x.split('.')[-1])
if normalized is None:
normalized = df
Expand Down Expand Up @@ -193,11 +194,11 @@ def tuple_of_secondary_keys(params: BMParams) -> Tuple:
return tuple(secondaryKeys)


def plot_all_results(params: BMParams, resultSets: ResultSets, path, include_benchmarks: str, exclude_benchmarks: str, label: str) -> None:
def plot_all_results(params: BMParams, xaxisparam:Dict, result_sets: ResultSets, path, include_benchmarks: str, exclude_benchmarks: str, label: str, value_size_title: str, system_info: str) -> None:
indexKeys = tuple_of_secondary_keys(params)
for indexTuple, resultSet in resultSets.items():
plot_result_set(indexKeys, indexTuple, resultSet,
path, include_benchmarks, exclude_benchmarks, label)
for indexTuple, resultSet in result_sets.items():
plot_result_set(xaxisparam, indexKeys, indexTuple, resultSet,
path, include_benchmarks, exclude_benchmarks, label, value_size_title, system_info)


def plot_result_axis_errorbars(ax, resultSet: ResultSet) -> None:
Expand Down Expand Up @@ -256,25 +257,42 @@ def plot_result_axis_bars(ax, resultSet: ResultSet) -> None:
bmIndex = bmIndex + 1


def plot_result_set(indexKeys: Tuple, indexTuple: Tuple, resultSet: ResultSet, path: pathlib.Path, include_benchmarks: str, exclude_benchmarks: str, label: str):
def plot_result_set(xaxisparam:Dict, indexKeys: Tuple, indexTuple: Tuple, resultSet: ResultSet, path: pathlib.Path, include_benchmarks: str, exclude_benchmarks: str, label: str, value_size_title: str, system_info: str):
# Determine how many colors we need
num_benchmarks = len(resultSet)

# Sample gist_ncar (or nipy_spectral) at discrete intervals
cmap = plt.get_cmap('gist_ncar')
colors = [cmap(i / num_benchmarks) for i in range(num_benchmarks)]

# Set the property cycle with these colors
plt.rc('axes', prop_cycle=plt.cycler('color', colors))

fig = plt.figure(num=None, figsize=(18, 12), dpi=80,
facecolor='w', edgecolor='k')
ax = plt.subplot()

plot_result_axis_bars(ax, resultSet)

plt.title(
f'{str(indexKeys)}={str(indexTuple)} include={include_benchmarks} exclude={exclude_benchmarks}')
plt.xlabel("X")
# Ensure more marks on the x-axis for log scale
ax.xaxis.set_major_locator(ticker.LogLocator(base=10.0, numticks=15))
ax.xaxis.set_minor_locator(ticker.LogLocator(base=10.0, subs='auto', numticks=15))
ax.xaxis.set_major_formatter(ticker.ScalarFormatter())
ax.xaxis.set_minor_formatter(ticker.NullFormatter())

plt.suptitle(system_info)
title = f'{str(indexKeys)}={str(indexTuple)} include={include_benchmarks} exclude={exclude_benchmarks} Value Size="{value_size_title}"'
plt.title(title)
plt.xlabel(extract_parameter_name(xaxisparam))
plt.ylabel("t (ns)")
plt.legend(loc='lower right')
plt.grid(b='True', which='both')
plt.legend(loc='upper left', bbox_to_anchor=(1, 1))
plt.grid(visible='True', which='both')

name = f'fig_{"_".join([str(t) for t in indexTuple])}_{label}.png'

if path.is_file():
path = path.parent()
fig.savefig(path.joinpath(name))
path = path.parent
fig.savefig(path.joinpath(name), bbox_inches='tight')


alpha_pattern = re.compile(f'[A-Za-z0-9_\-+]')
Expand Down Expand Up @@ -311,7 +329,7 @@ def filter_for_benchmarks(dataframe: DataFrame, include_benchmarks, exclude_benc

def filter_for_range(dataframe: DataFrame, xaxisparam: Dict) -> DataFrame:

param_name = required('name', xaxisparam)
param_name = extract_parameter_name(xaxisparam)
xmin = optional('min', xaxisparam, lambda x: int(x))
xmax = optional('max', xaxisparam, lambda x: int(x))
if xmax is None and xmin is None:
Expand All @@ -329,6 +347,14 @@ def filter_for_range(dataframe: DataFrame, xaxisparam: Dict) -> DataFrame:
lambda x: int(x) >= xmin and int(x) <= xmax)]


def extract_parameter_name(xaxisparam):
return required('name', xaxisparam)


def default_if_none(optional_string, default_value: str) -> str:
return default_value if optional_string is None else optional_string


def process_some_plots(path: pathlib.Path, plot: Dict) -> None:

xaxisparam = required('xaxisparam', plot)
Expand All @@ -337,6 +363,26 @@ def process_some_plots(path: pathlib.Path, plot: Dict) -> None:
include_benchmarks = optional('include_patterns', plot)
exclude_benchmarks = optional('exclude_patterns', plot)
label = required('label', plot)
value_size_title = default_if_none(optional('valueSizeTitle', plot), "All")

# Check for system_info.json in the path
system_info = None
system_info_file = None
if path.is_dir():
system_info_file = path.joinpath('system_info.json')
if path.is_file():
system_info_file = path.parent.joinpath('system_info.json')

if system_info_file and system_info_file.exists():
try:
with system_info_file.open(mode='r', encoding='UTF-8') as f:
info_json = json.load(f)
system_info = info_json.get('system_info')
except Exception:
pass

if system_info is None:
system_info = "System Info unavailable"

dataframe = normalize_data_frame_from_path(path)
if len(dataframe) == 0:
Expand All @@ -357,8 +403,8 @@ def process_some_plots(path: pathlib.Path, plot: Dict) -> None:
params: BMParams = split_params(
extract_params(dataframe), primary_param_name)
resultSets = extract_results_per_param(dataframe, params)
plot_all_results(params, resultSets, path,
include_benchmarks, exclude_benchmarks, label)
plot_all_results(params, xaxisparam, resultSets, path,
include_benchmarks, exclude_benchmarks, label, value_size_title, system_info)


def process_benchmarks(config: Dict) -> None:
Expand Down
Loading