Roblox / roact-performance-benchmarks

Performance benchmarks for Roact. This a read-only mirror

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests

Performance Benchmarking Lua

Getting started


Rust

(optional section)

Foreman toolchain manager uses Rust so you might want to install it first. Go to the official installation instructions to get installation steps for your platform

We can use cargo to install other required packages. It's a package manager for Rust so it's like npm in the Rust world.

Ensure cargo is available in your PATH:

cargo --version
cargo --help

Foreman

You can grab the foreman's binary from the foreman GitHub releases section

We can also use cargo to install foreman (requires Rust installation)

cargo install foreman

Verify the installation:

foreman --version
foreman --help

GitHub API Key

We need GitHub API key to fetch tools that are private to Roblox. Generate a new access token:

GitHub > Settings > Developer > Personal Access Tokens

Set scopes:

  • repo
    • workflow
    • packages
      • read:packages

scopes example

In a repository

  • Install using foreman

    Forman installs toolchain packages from github repos based on the forman.toml

    In a repo you're working with:

    foreman github-api <github_api_key>
    foreman install

    Add foreman install directory to your PATH

    export PATH=$PATH:$HOME/.foreman/bin
  • Install using Rotriever

    Rotrieve installs packages (similar to npm) from github repos based on the rotriever.toml

    rotrieve --git-auth <username>@<github_api_key> install
    
    
    # syntax for Rotriever version >= 5
    # rotrieve install --auth https://<username>:<github_api_key>@github.com

    If you fall out of sync, your rotriever.lock file tags to a specific sha - you can call:

    rotrieve --git-auth <username>@<github_api_key> upgrade
    
    
    # syntax for Rotriever version >= 5
    # rotrieve upgrade --auth https://<username>:<github_api_key>@github.com

    Note: If you get the following error on mac

    dyld: Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib Referenced from: ~/.foreman/tools/roblox__rotriever-0.4.3 Reason: image not found

    You can install using brew:

    brew install openssl@1.1

    This doesn't seem to work on Apple Silicon Macs 😞

Running tests

./bin/ci-tests.sh

Running benchmarks in Roblox CLI


Concurrent example

First you need to build the project

rojo build ci.project.json --output ci.rbxm

Time to first render benchmark

roblox-cli run --load.model ci.rbxm --run scripts/run-first-render-benchmark.lua --headlessRenderer 1

FPS benchmark

roblox-cli run --load.model ci.rbxm --run scripts/run-frame-rate-benchmark.lua --headlessRenderer 1

If you want to run all examples at once there is a script to to that:

./bin/ci-benchmarks.sh

React Native Web benchmarks example


Coming soon...

Running benchmarks in Roblox Studio


Concurrent example

The easiest way to run the example in Roblox Studio is to sync files using Rojo.

Start Rojo server

rojo serve concurrent.project.json

Roblox Studio

In Roblox Studio:

  • Open project with an empty baseplate
  • Using Rojo plugin connect to the Rojo server you've created

Rojo connect Rojo connected

  • Click Play button (or F5)

React Native Web benchmarks example


Coming soon...

About

Performance benchmarks for Roact. This a read-only mirror

License:MIT License


Languages

Language:Lua 93.4%Language:Shell 6.6%