Derping about

Benchmark created on


Setup

const allUniforms = [
  'uniform2fv',
  'uniform2iv',
  //uniform === 'uniform3fv	' || <--- check why this isnt recognized
  'uniform3iv',
  'uniform4fv',
  'uniform4iv',
  'uniformMatrix2fv',
  'uniformMatrix3fv',
  'uniformMatrix4fv',
  'uniform1f',
  'uniform1fv',
  'uniform1i',
  'uniform1iv'
]

Test runner

Ready to run.

Testing in
TestOps/sec
charAT
const l = allUniforms.length;
for(let i = 0; i < l; i++) {
  const uniform = allUniforms[i];
  const target = uniform.charAt('7')
  if(target === '1' ) {
    console.log('do all')
    continue
  }
  if(uniform.endsWith('v')) {
    console.log('do all')
    continue
  }
  if(target === '2') {
    console.log('spread 2')
    continue
  }
  if(target === '3') {
    console.log('spread 3')
    continue
  }
  if(target === '4') {
    console.log('spread 4')
    continue
  }
}
ready
uniform === 'uniformName'
const l = allUniforms.length;
for(let i = 0; i < l; i++) {
  const uniform = allUniforms[i];
  if (
  
  uniform === 'uniform2fv' ||
  uniform === 'uniform2iv' ||
  //uniform === 'uniform3fv	' || <--- check why this isnt recognized
  uniform === 'uniform3iv' ||
  uniform === 'uniform4fv' ||
  uniform === 'uniform4iv' ||
  uniform === 'uniformMatrix2fv' ||
  uniform === 'uniformMatrix3fv' ||
  uniform === 'uniformMatrix4fv' ||
  uniform === 'uniform1f' ||
  uniform === 'uniform1fv' ||
  uniform === 'uniform1i' ||
  uniform === 'uniform1iv'
) {
  console.log('do all values')
    continue
}

if (uniform === 'uniform2f' || uniform === 'uniform2i') {
  console.log('spread 2')
  continue
}

if (uniform === 'uniform3f' || uniform === 'uniform3i') {
  console.log('spread 4')
  continue
}

if (uniform === 'uniform4f' || uniform === 'uniform4i') {
  console.log('spread 4')
  continue
}
  
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.