Skip to content
Martín Dias edited this page Mar 12, 2024 · 23 revisions

Welcome to the BlocBenchs wiki!

Install

  1. Download Pharo 11 or 12

  2. Load the baseline with:

EpMonitor disableDuring: [
  Author useAuthor: 'Load' during: [
    [	Metacello new
        baseline: 'BlocBenchs';
        repository: 'github://pharo-graphics/BlocBenchs:master/src';
        onConflictUseIncoming;
        ignoreImage;
        load.
    ]	on: MCMergeOrLoadWarning
      do: [ :warning | warning load ] ] ]

Alternative Install

We have a build script that downloads Pharo and loads the project. It's prepared to work on MacOS, Linux and Windows (tested with the bash shell terminal that comes with git for Windows).

To use it:

  1. Clone this repository (this will be the <repo_path>)
  2. Create anywhere in your system a directory where the image will be build, and open a terminal there.
  3. Execute <repo_path>/scripts/build.sh

How to use

You can find executable entry-points here:

  • Run examples at class-side of PCBenchmarker
  • Run examples at class-side of BlProfileRunner
  • Run BlMouseMoveBenchmark class>>#exampleRun
  • Run PCMeanConfidenceIntervalPrinter class>>·example
  • Run AeBenchFigureGridRunner in BlocBenchs-Alexandrie

Code snippets

The following snippet serves to benchmark FPS (frames per second) of Bloc's rounded rectangle geometry. You can easily create a new case (to replace PCRoundedRectanglesBenchCase). See FPS report in Transcript.

PCBenchmarkSuite new
   addCase: PCRoundedRectanglesBenchCase new;
   numberOfSeconds: 7;
   addAlexandrieBenchmarker;
   runInForkWithGUI

Variations of the following snippet serves to benchmark multiple performance aspects:

[ case := BlBoidsProfileCase new.
case duration: 7 seconds.
case hostClass: BlOSWindowSDL2Host.
(BlProfileRunner newForCase: case)
   enableFPS;
   run;
   openMeterReports ] fork

This will execute the Boids demo for 7 seconds. You can replace BlBoidsProfileCase by your own.

  • Sending enableFPS makes you get a FPS report for each execution second.
  • Replace enableFPS by enableFFICounter to get a ranking of FFI calls per frame sorted by frequency.
  • Replace by enableASProfiler to get a profiler.
Clone this wiki locally