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 totalTabelas = 3;
const totalProdutos = 100000;
function opcao1() {
const json = {
tabelas: []
}
for (let i=0; i<totalTabelas; i++) {
const precos = [];
for(let j=0; j<totalProdutos; j++) {
precos.push({
referenciacor: j.toString(),
produtoId: j.toString(),
precoTabela: 59.9,
precoPromocional: 49.9,
precoCadastro: 59.9
});
}
json.tabelas.push({
tabelaId: i.toString(),
nome: `Tabela ${i}`,
precos: precos
});
}
return json;
}
function opcao2() {
const totalRegistros = totalTabelas * totalProdutos;
const json = [];
for(let i=0; i<totalRegistros; i++) {
json.push({
tabelaId: i.toString(),
nome: `Tabela ${i}`,
referenciacor: i.toString(),
produtoId: i.toString(),
precoTabela: 59.9,
precoPromocional: 49.9,
precoCadastro: 59.9
});
}
return json;
}
const dadosOpcao1 = opcao1();
const dadosOpcao2 = opcao2();
const tabelaId = Math.floor(Math.random() * totalTabelas).toString();
const produtoId = Math.floor(Math.random() * totalProdutos).toString();
Ready to run.
Test | Ops/sec | |
---|---|---|
Serializando 1 |
| ready |
Serializando 2 |
| ready |
Buscando 1 |
| ready |
Buscando 2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.