jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
const MONTH = [
["январь", "января"],
["февраль", "февраля"],
["март", "марта"],
["апрель", "апреля"],
["май", "мая"],
["июнь", "июня"],
["июль", "июля"],
["август", "августа"],
["сентябрь", "сентября"],
["октябрь", "октября"],
["ноябрь", "ноября"],
["декабрь", "декабря"],
]
const WEEKDAYS = ["Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота", "Воскресенье"]
function format(date, format = "d.m.Y") {
const d = `0${date.getDate()}`.slice(-2)
const j = `${date.getDate()}`
let Y = `${date.getFullYear()}`
const w = `${date.getDay()}`
const F = MONTH[date.getMonth()][0]
const FG = MONTH[date.getMonth()][1]
const m = `0${date.getMonth() + 1}`.slice(-2)
const n = `${date.getMonth() + 1}`
const y = Y.slice(-2)
const H = `0${date.getHours()}`.slice(-2)
const G = `${date.getHours()}`
const i = `0${date.getMinutes()}`.slice(-2)
const s = `0${date.getSeconds()}`.slice(-2)
const WD = WEEKDAYS[(date.getDay() + 6) % 7]
return format
.replace("d", d)
.replace("j", j)
.replace("w", w)
.replace("FG", FG)
.replace("F", F)
.replace("m", m)
.replace("n", n)
.replace("Y", Y)
.replace("y", y)
.replace("H", H)
.replace("G", G)
.replace("i", i)
.replace("s", s)
.replace("WD", WD.toLowerCase())
.trim()
}
Ready to run.
Test | Ops/sec | |
---|---|---|
a |
| ready |
b |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.