RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Bananabench AsyncBananabench CSVBananabench JSONBananabench PrintBananabench XMLBananabenchPhysics BenchmarkBeamConsole Folder OverviewJSON PerformanceConsole MainResave Parts ConfigsServer TestsSimple LoadSimulation TestDynamic Collision TestMain Development TestUnit Tests

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API Referenceconsole

Bananabench

Module defined in `lua/console/bananabench.lua`. Core physics benchmarking module that measures beam simulation throughput (MBeams/s) and real-time performance percentage across multiple vehicles.

Module defined in lua/console/bananabench.lua. Core physics benchmarking module that measures beam simulation throughput (MBeams/s) and real-time performance percentage across multiple vehicles.


Functions/Exports

M.physics(vehicles, vehicleMin, vehicleMax) (exported as benchPhysics)

Main benchmark entry point. Spawns vehicles and measures physics performance.

  • vehicles - table of vehicle directory names (default: {'pickup'})
  • vehicleMin - starting vehicle count (default: 1)
  • vehicleMax - max vehicle count (default: VehiclesToTest or 40)
  • Returns a results table with per-vehicle test data (MBeams/s, % realtime, timing)

M.getAllVehicles()

Scans /vehicles directory and returns list of all vehicle names (excludes /vehicles/common).

myBenchStep(testVehicle, vehLPackData, n, steps) (global)

Runs a single benchmark step: spawns n vehicles, runs physics update loop, returns spawn time and minimum frame time.

  • Disables GC and JIT during measurement for consistency
  • Checks for physics instability after each run

benchLog(level, origin, msg, newline) (global)

Custom log handler that caches log messages and tracks max severity (warn/error). Filters out A/D/S level messages.

loadVehicle(vehicleDir) (local)

Loads a vehicle via jbeam/loader stage1 and returns lpack-encoded data.

formatRes(res) (local, nested inside benchPhysics)

Formats a single result entry (MBeams/s and % realtime) for table output row. Nested helper within the output print loop.

Configuration

  • physicsFPS = 2000 - physics simulation rate
  • physicsSteps = 100 - max physics steps per update (do NOT increase beyond 100)
  • gfxSteps = 200 - graphics frame steps per benchmark run
  • defaultVehicleCount = 40 - default max vehicles to test
  • version = '0.5'

Usage

local bench = require("lua/console/bananabench")
local res = bench.physics()  -- benchmark default vehicle (pickup), 1-40 count
local res = bench.physics({'pickup', 'pigeon'}, 1, 20)  -- custom vehicles/range
local vehicles = bench.getAllVehicles()  -- get all available vehicles

Internal Notes

  • Uses HighPerfTimer for precise timing measurements
  • Calls setPowerPlanMaxPerformance() / restorePowerPlan() to ensure consistent CPU performance
  • Spawns vehicles at 300m intervals to avoid collisions
  • Warmup round of 5 steps before actual measurement
  • Collects minimum frame time across all gfxSteps iterations
  • Results include: MBeams/s, % realtime, spawn time, execution time per vehicle count
  • Outputs ASCII banana art on completion

See Also

  • BeamConsole Folder Overview - Directory overview
  • bananabench-async Reference - Related reference
  • bananabench-csv Reference - Related reference
  • bananabench-json Reference - Related reference
  • Console Commands Guide - Guide

Bananabench XML

Script defined in `lua/console/bananabench-xml.lua`. Runs bananabench on a predefined set of vehicles and exports results as XML, suitable for CI/CD performance reporting.

Physics Benchmark

Script defined in `lua/console/benchphysics.lua`. Simple legacy physics scaling benchmark that measures per-frame delay as vehicle count increases, outputting results to CSV.

On this page

Functions/ExportsM.physics(vehicles, vehicleMin, vehicleMax) (exported as benchPhysics)M.getAllVehicles()myBenchStep(testVehicle, vehLPackData, n, steps) (global)benchLog(level, origin, msg, newline) (global)loadVehicle(vehicleDir) (local)formatRes(res) (local, nested inside benchPhysics)ConfigurationUsageInternal NotesSee Also