From 983c2dbcc03ea9a71d1f5dddae82c0f70691470b Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sun, 15 Mar 2026 20:18:55 +0200 Subject: [PATCH] feat(benchmark): add system info to benchmark output - Display CPU name, architecture, and core count - Simplify output format (removed Duration and Frames columns) - Add Star Grid test to benchmark suite - Update documentation with new benchmark results --- doc/index.org | 24 +++++++---- .../examples/benchmark/GraphicsBenchmark.java | 41 ++++++++++++++----- 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/doc/index.org b/doc/index.org index c6606cb..92d3d10 100644 --- a/doc/index.org +++ b/doc/index.org @@ -217,17 +217,25 @@ Example benchmark results: ================================================================================ GRAPHICS BENCHMARK RESULTS ================================================================================ -Date: 2026-03-15 04:53:17 -Resolution: 1920x1080 -Cubes: 4096 (16x16x16 grid) -Duration: 30 seconds per test +Date: 2026-03-15 20:16:01 +Resolution: 1920x1080 +Cubes: 4096 (16x16x16 grid) +Duration: 30 seconds per test -------------------------------------------------------------------------------- -Test Duration Frames Avg FPS +SYSTEM INFORMATION -------------------------------------------------------------------------------- -Solid Cubes 30.02s 1136 37.84 -Textured Cubes 30.00s 793 26.43 -Wireframe Cubes 30.01s 1161 38.69 +CPU Name: AMD Ryzen AI 9 HX 370 w/ Radeon 890M +Arch: amd64 +Cores: 24 + +-------------------------------------------------------------------------------- +Test Avg FPS +-------------------------------------------------------------------------------- +Solid Cubes 35.65 +Textured Cubes 26.08 +Wireframe Cubes 33.67 +Star Grid 256.88 ================================================================================ #+end_example diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/GraphicsBenchmark.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/GraphicsBenchmark.java index 1f93318..96a50dc 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/GraphicsBenchmark.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/GraphicsBenchmark.java @@ -153,29 +153,50 @@ public class GraphicsBenchmark implements FrameListener, KeyboardInputHandler { String separator = "================================================================================"; String thinSeparator = "--------------------------------------------------------------------------------"; + Runtime runtime = Runtime.getRuntime(); + System.out.println(separator); System.out.println(" GRAPHICS BENCHMARK RESULTS"); System.out.println(separator); - System.out.println("Date: " + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); - System.out.println("Resolution: " + WINDOW_WIDTH + "x" + WINDOW_HEIGHT); - System.out.println("Cubes: " + (GRID_SIZE * GRID_SIZE * GRID_SIZE) + " (" + GRID_SIZE + "x" + GRID_SIZE + "x" + GRID_SIZE + " grid)"); - System.out.println("Duration: " + (TEST_DURATION_MS / 1000) + " seconds per test"); + System.out.println("Date: " + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + System.out.println("Resolution: " + WINDOW_WIDTH + "x" + WINDOW_HEIGHT); + System.out.println("Cubes: " + (GRID_SIZE * GRID_SIZE * GRID_SIZE) + " (" + GRID_SIZE + "x" + GRID_SIZE + "x" + GRID_SIZE + " grid)"); + System.out.println("Duration: " + (TEST_DURATION_MS / 1000) + " seconds per test"); + System.out.println(); + System.out.println(thinSeparator); + System.out.println("SYSTEM INFORMATION"); + System.out.println(thinSeparator); + System.out.println("CPU Name: " + getCpuName()); + System.out.println("Arch: " + System.getProperty("os.arch")); + System.out.println("Cores: " + runtime.availableProcessors()); System.out.println(); System.out.println(thinSeparator); - System.out.printf("%-28s %-11s %-9s %-10s%n", "Test", "Duration", "Frames", "Avg FPS"); + System.out.printf("%-28s %s%n", "Test", "Avg FPS"); System.out.println(thinSeparator); for (TestResult result : results) { - System.out.printf("%-28s %-11s %-9d %-10.2f%n", - result.testName, - String.format("%.2fs", result.durationSeconds), - result.frameCount, - result.averageFps); + System.out.printf("%-28s %.2f%n", result.testName, result.averageFps); } System.out.println(separator); } + private String getCpuName() { + try { + java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader("/proc/cpuinfo")); + String line; + while ((line = reader.readLine()) != null) { + if (line.startsWith("model name")) { + reader.close(); + return line.substring(line.indexOf(':') + 1).trim(); + } + } + reader.close(); + } catch (Exception ignored) { + } + return System.getProperty("java.vm.name", "Unknown"); + } + @Override public boolean onFrame(ViewPanel viewPanel, int millisecondsSinceLastFrame) { // Perform deferred test transition at safe point (before render cycle starts) -- 2.20.1