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 items = [];
for (let i = 0; i < 1000; i++) {
const book =
"Rousillon. The COUNT's palace.Enter COUNTESS and ClownCOUNTESSCome on, sir; I shall now put you to the height ofyour breeding.ClownI will show myself highly fed and lowly taught: Iknow my business is but to the court.COUNTESSTo the court! why, what place make you special,when you put off that with such contempt? But to the court!ClownTruly, madam, if God have lent a man any manners, hemay easily put it off at court: he that cannot makea leg, put off's cap, kiss his hand and say nothing,has neither leg, hands, lip, nor cap; and indeedsuch a fellow, to say precisely, were not for thecourt; but for me, I have an answer will serve allmen.COUNTESSMarry, that's a bountiful answer that fits allquestions.ClownIt is like a barber's chair that fits all buttocks,the pin-buttock, the quatch-buttock, the brawnbuttock, or any buttock.COUNTESSWill your answer serve fit to all questions?ClownAs fit as ten groats is for the hand of an attorney,as your French crown for your taffeta punk, as Tib'srush for Tom's forefinger, as a pancake for ShroveTuesday, a morris for May-day, as the nail to hishole, the cuckold to his horn, as a scolding queento a wrangling knave, as the nun's lip to thefriar's mouth, nay, as the pudding to his skin.COUNTESSHave you, I say, an answer of such fitness for allquestions?ClownFrom below your duke to beneath your constable, itwill fit any question.COUNTESSIt must be an answer of most monstrous size thatmust fit all demands.ClownBut a trifle neither, in good faith, if the learnedshould speak truth of it: here it is, and all thatbelongs to't. Ask me if I am a courtier: it shalldo you no harm to learn.COUNTESSTo be young again, if we could: I will be a fool inquestion, hoping to be the wiser by your answer. Ipray you, sir, are you a courtier?ClownO Lord, sir! There's a simple putting off. More,more, a hundred of them.COUNTESSSir, I am a poor friend of yours, that loves you.ClownO Lord, sir! Thick, thick, spare not me.COUNTESSI think, sir, you can eat none of this homely meat.ClownO Lord, sir! Nay, put me to't, I warrant you.COUNTESSYou were lately whipped, sir, as I think.ClownO Lord, sir! spare not me.COUNTESSDo you cry, 'O Lord, sir!' at your whipping, and'spare not me?' Indeed your 'O Lord, sir!' is verysequent to your whipping: you would answer very wellto a whipping, if you were but bound to't.ClownI ne'er had worse luck in my life in my 'O Lord,sir!' I see things may serve long, but not serve ever.COUNTESSI play the noble housewife with the timeTo entertain't so merrily with a fool.ClownO Lord, sir! why, there't serves well again.COUNTESSAn end, sir; to your business. Give Helen this,And urge her to a present answer back:Commend me to my kinsmen and my son:This is not much.ClownNot much commendation to them.COUNTESSNot much employment for you: you understand me?";
const wordsInString = book.split(" ");
const obj = {
name: `name${i}`,
book,
};
for (let j = 0; j < 1000; j++) {
const wordIndex = Math.floor(Math.random() * wordsInString.length);
const randomWord = wordsInString[wordIndex];
obj[`word${j}`] = randomWord;
}
items.push(obj);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Mutation |
| ready |
Spread |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.