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
Analisar o teste entre condicional de string VS array para popular um objeto
<div id="tag"></div>
<div id="msg"></div>
var listaStatus ={
01:{
tag:"realizado",
msg:"Seu pedido 59140876 já está em análise."
},
02:{
tag:"cancelado",
msg:"Não foi possível"
},
03:{
tag:"entregue",
msg:"Seu pedido 59140876 foi entregue"
}
};
var pedidos = {
01: {
status: "entregue",
product: "fixa"
},
02: {
status: 03,
product: "fixa"
}
};
function writeCard($tag,$msg){
document.getElementById("tag").innerText = $tag;
document.getElementById("msg").innerText = $msg;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Condicional |
| ready |
Array |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.