HTML Preparation code:
AخA
 
1
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.29.0/ramda.min.js"></script>
Script Preparation code:
x
 
var fromIdVanilla = (id) => {
  const map = new Map()
  if (id) {
    for (const segement of id.split(';')) {
      const [key, value] = segement.split('=')
      map.set(key, value)
    }
  }
  return map
}
var fromIdRamda = R.pipe(R.split(';'), R.reject(R.isEmpty), R.map(R.split('=')), x => new Map(x))
Tests:
  • Vanilla

     
    fromIdVanilla('Type=Text;Id=1;Foo=Bar')
  • Ramda

     
    fromIdRamda('Type=Text;Id=1;Foo=Bar')
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Vanilla
    Ramda

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Chrome 116 on Windows
View result in a separate tab
Test name Executions per second
Vanilla 3223425.0 Ops/sec
Ramda 809902.3 Ops/sec