String template vs cast for number

Benchmark created on


Setup

const year = 2025;

Test runner

Ready to run.

Testing in
TestOps/sec
String template
`${year}`;
ready
Simple cast
year.toString();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.