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
how slow is JSON.stringify?
var foo = {
sectionTitle: 'Our Contributors',
sectionDescription:
'Meet the talented team of writers, analysts, and experts who make Defector possible.',
itemSubtitle1: 'Sports Journalist',
itemTitle1: 'Joe Smith',
itemDescription1:
'Joe is a veteran sports journalist with over 10 years of experience covering the NFL, NBA, and MLB. He has written for several major publications and is known for his in-depth analysis and insightful commentary.',
itemSubtitle2: 'Data Analyst',
itemTitle2: 'Jane Doe',
itemDescription2:
'Jane is a data analyst with a background in statistics and computer science. She uses her skills to provide detailed analysis and visualizations of sports data, helping readers gain a deeper understanding of the game.',
itemSubtitle3: 'Sports Historian',
itemTitle3: 'John Johnson',
itemDescription3:
'John is a sports historian with a Ph.D. in American Studies. He has written several books on the history of sports and is a frequent guest on sports talk shows, providing historical context and perspective.',
};
var bar = {
heading: 'New Moon Natural Foods: Your Community Market',
subheading: 'Welcome to a Healthier Way of Life',
description:
'At New Moon Natural Foods, we are committed to providing our community with the highest quality organic produce, locally-sourced meats, and carefully curated health and wellness products. We also offer a unique selection of beer, wine, and cheese, as well as all the best in natural grocery. Our family-owned market is dedicated to supporting local growers and artisans, while providing a welcoming and supportive environment for our customers to find the healthiest and most sustainable options for their families. Join us on your journey to a healthier way of life.',
};
function stringifyCheck(a, b) {
return JSON.stringify(a).length >= JSON.stringify(b).length;
}
function objectKeysCheck(a, b) {
return Object.keys(a).length >= Object.keys(b).length;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
JSON.stringify |
| ready |
Object.keys() |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.