Skip to content

Easier "latest" benchmark #20

Description

@chneau

Using bun, with bun update to update all and then on benchmark.mjs importing package.json to get the versions:

something like this:

import pkg from "./package.json" with { type: "json" };

// ...


const farmVersion = pkg.devDependencies["@farmfe/core"].replace("^", "");
const rsbuildVersion = pkg.devDependencies["@rsbuild/core"].replace("^", "");
const viteVersion = pkg.devDependencies.vite.replace("^", "");
const webpackVersion = pkg.devDependencies.webpack.replace("^", "");

// modified bits


const brandColor = new Map([
	[`Farm ${farmVersion}`, purple],
	[`Farm ${farmVersion} (Hot)`, purple],
	[`RsBuild ${rsbuildVersion}`, green],
	[`RsBuild ${rsbuildVersion} (Hot)`, green],
	[`Vite ${viteVersion}`, magenta],
	[`Vite ${viteVersion} (Hot)`, magenta],
	[`Webpack ${webpackVersion}`, cyan],
	[`Webpack ${webpackVersion} (Hot)`, cyan],
]);

// modified bits


const buildTools = [
	new BuildTool(
		`Farm ${farmVersion}`,
		9000,
		"start:farm",
		/Ready\s*in\s*(.+?)(m?s)/,
		"build:farm",
		/completed\s*in\s*(.+?)(m?s)/,
		"@farmfe/cli/bin/farm.mjs",
	),
// etc...

Example: https://github.com/chneau/farm-performance-compare

It makes it easier to have a up to date picture compared to other tools:

as of now 2025-03-17:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions