We’re building a Benchmark App

One thing I have always missed in Business Central is a simple performance indicator, something I can run and get a simple score for my system. So I have started building an app for that, and I would love for you to participate. I have written the first part of the app, open-sourced the code and hope that you would like to be part of this. Check the video for all the details.

https://youtu.be/hG2IO-7G_Bs

The code is here: hougaard/BCBenchmark: BC Benchmark (github.com)


In this video, Erik introduces an exciting community project: a benchmark application for Business Central built in AL. The app aims to provide a simple, non-technical way to measure and compare Business Central performance — similar to how tools like 3DMark or Geekbench let you compare hardware scores. Erik walks through the current state of the code, demonstrates the app running in a Docker instance, and invites the community to participate in building and refining the benchmark tests.

The Vision: A Benchmark Score for Business Central

Erik has always wanted a straightforward way to measure Business Central performance — something that produces a single score you can use to determine whether your system’s performance is good, bad, or somewhere in between. The inspiration comes from consumer hardware benchmarks:

  • When shopping for a phone or graphics card, you compare benchmark scores
  • The same concept should apply to Business Central environments
  • Higher score = better performance (gamification makes it fun and intuitive)
  • Scores should be comparable across different environments — cloud, on-prem, different data centers

Demo: Running the Benchmark

Erik demonstrates the app running on his Surface Book in a Docker instance. Searching for “BC Benchmark” brings up a single page showing the last benchmark score. Clicking “Run” launches the benchmark as a background session via Session.StartSession, which means you can continue working in Business Central — creating sales quotes, for example — while the benchmark runs. When it completes, you can check back and see your new score.

Architecture: How It Works

The app cleverly leverages Business Central’s existing test framework infrastructure. Here’s how the pieces fit together:

The Test Runner Pattern

Business Central has a robust system for running automated tests that isolates test execution — after a test completes, nothing is written to the database even though the test code writes data during execution. The benchmark app repurposes this system to run benchmark operations instead of traditional tests.

The benchmark runner codeunit acts as the test runner, and individual benchmark tests are registered as test methods. Currently there are three benchmark tests:

  • Sales — Creates and posts sales orders
  • Purchase — Creates and posts purchase orders
  • Loops — A CPU-intensive placeholder test

The Scoring Approach

To turn code execution into a meaningful number where “higher is better,” the approach is simple: perform as many operations as possible within a fixed time window. Each test runs in a loop for a set duration (currently 10 seconds) and counts how many iterations it can complete.

For example, the sales benchmark test:

  1. Finds an unblocked customer
  2. Finds an unblocked item
  3. Creates a sales order for that customer with that item
  4. Ships and posts the sales order
  5. Repeats as many times as possible within the allotted time

The purchase test follows the same pattern but uses purchase variables, vendors, and vendor invoice numbers.

The Score Keeper: Solving Inter-Session Communication

One of the interesting technical challenges was communicating results from the background test session back to the UI. Business Central doesn’t have built-in inter-thread communication, and since the code runs inside a test codeunit, any database writes get rolled back when the test finishes.

Erik’s solution uses a single-instance codeunit as the score keeper. It accumulates all test results in a JSON object held in memory (memory doesn’t get rolled back with the test transaction). Then, in the OnAfterTestRun trigger — after the test isolation ends — the accumulated data is written to isolated storage, where the UI page can read it.

The CPU Test Challenge

The loops test is designed to measure single-thread CPU performance independent of database or other subsystems. However, there’s an important consideration: the operations must be meaningful enough that the AL compiler won’t optimize them away. As Erik puts it, “those compiler guys are sneaky bastards” — if the compiler determines that a loop isn’t doing anything meaningful, it might optimize it out entirely, making results unreliable.

Community Participation: Where You Come In

This is explicitly designed as a community effort. The code is open source under the MIT license in a dedicated GitHub repository (separate from Erik’s usual YouTube code repository). There’s even a template test that provides all the boilerplate code — you just need to implement the actual test logic.

Areas where help is needed:

  • More benchmark tests — Reports, XMLports, streams, and anything else you consider important for real-world performance
  • Test weighting — Once the full palette of tests is established, they need to be weighted relative to each other so the combined score is meaningful
  • Data compatibility — All tests must run on Cronus data from any localization of Business Central, which introduces challenges around dimensions, posting requirements, and localization-specific setup
  • An “About” page — A page that showcases all the community members who contributed to the project

Future Plans: Score Comparison Service

Beyond just generating a score, Erik envisions a comparison service where you can:

  • Submit your score through a web service
  • Pull comparable results from other anonymized submissions
  • Include meaningful metadata: cloud vs. on-prem, server type, data center location, database size
  • Compare your performance against others in similar configurations

This could answer questions like: Is my system faster than the cloud? Are users on the West data center getting better performance than those on the East? Is a particular app installed on my system causing a slowdown?

AppSource and Pipeline Integration

The app is intended for AppSource publication, which is why all object names are postfixed with “HDD” — Erik’s registered AppSource prefix required for validation and publication.

An interesting idea came from a community member named Luke on Twitter: running the benchmark as part of a CI/CD build pipeline. This would let you detect performance regressions — if you typically score a certain number but then check in some code and see the score drop significantly, you’d know something needs attention.

Summary

The BC Benchmark app is an ambitious community project to bring standardized performance measurement to Business Central. By leveraging the existing test framework, isolated storage for inter-session communication, and a time-boxed approach to scoring, the foundation is solid. What it needs now is community participation — more tests covering real-world scenarios, help with score weighting, and contributions of all kinds. The code is MIT-licensed and available on GitHub, and contributions can be submitted via pull requests or in whatever format works for contributors. If this project succeeds, it could become the “Geekbench for Business Central” — a trusted, community-built tool for measuring and comparing system performance.