Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
shaders strings comparisons
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Browser:
Chrome 123
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
a, b equality
7384511.0 Ops/sec
a, b locale compare
7205676.5 Ops/sec
a, c equality
7300067.0 Ops/sec
a, c locale compare
7021438.0 Ops/sec
Script Preparation code:
var a = ` struct Matrices { model: mat4x4f, world: mat4x4f, modelView: mat4x4f, modelViewProjection: mat4x4f }; fn getVertex2DToUVCoords(vertex: vec2f) -> vec2f { return vec2( vertex.x * 0.5 + 0.5, 0.5 - vertex.y * 0.5 ); } fn getVertex3DToUVCoords(vertex: vec3f) -> vec2f { return vec2( vertex.x * 0.5 + 0.5, 0.5 - vertex.y * 0.5 ); } fn getUVCover(uv: vec2f, textureMatrix: mat4x4f) -> vec2f { return (textureMatrix * vec4f(uv, 0.0, 1.0)).xy; } @group(1) @binding(0) var<uniform> matrices: Matrices; struct VSOutput { @builtin(position) position: vec4f, @location(0) uv: vec2f, @location(1) normal: vec3f, }; @fragment fn main(fsInput: VSOutput) -> @location(0) vec4f { // normals return vec4(normalize(fsInput.normal) * 0.5 + 0.5, 1.0); }` var b = ` struct Matrices { model: mat4x4f, world: mat4x4f, modelView: mat4x4f, modelViewProjection: mat4x4f }; fn getVertex2DToUVCoords(vertex: vec2f) -> vec2f { return vec2( vertex.x * 0.5 + 0.5, 0.5 - vertex.y * 0.5 ); } fn getVertex3DToUVCoords(vertex: vec3f) -> vec2f { return vec2( vertex.x * 0.5 + 0.5, 0.5 - vertex.y * 0.5 ); } fn getUVCover(uv: vec2f, textureMatrix: mat4x4f) -> vec2f { return (textureMatrix * vec4f(uv, 0.0, 1.0)).xy; } @group(1) @binding(0) var<uniform> matrices: Matrices; struct VSOutput { @builtin(position) position: vec4f, @location(0) uv: vec2f, @location(1) normal: vec3f, }; @fragment fn main(fsInput: VSOutput) -> @location(0) vec4f { // normals return vec4(normalize(fsInput.normal) * 0.5 + 0.5, 1.0); }` var c = `struct Attributes { @builtin(vertex_index) vertexIndex : u32, @builtin(instance_index) instanceIndex : u32, @location(0) position: vec3f, @location(1) uv: vec2f, @location(2) normal: vec3f }; struct Matrices { model: mat4x4f, world: mat4x4f, modelView: mat4x4f, modelViewProjection: mat4x4f }; struct Camera { model: mat4x4f, view: mat4x4f, projection: mat4x4f }; fn getOutputPosition(position: vec3f) -> vec4f { return matrices.modelViewProjection * vec4f(position, 1.0); } fn getUVCover(uv: vec2f, textureMatrix: mat4x4f) -> vec2f { return (textureMatrix * vec4f(uv, 0.0, 1.0)).xy; } @group(0) @binding(0) var<uniform> camera: Camera; @group(1) @binding(0) var<uniform> matrices: Matrices; struct VertexOutput { @builtin(position) position: vec4f, @location(0) uv: vec2f, @location(1) normal: vec3f, }; @vertex fn main( attributes: Attributes, ) -> VertexOutput { var vsOutput: VertexOutput; vsOutput.position = getOutputPosition(attributes.position); vsOutput.uv = attributes.uv; vsOutput.normal = attributes.normal; return vsOutput; }`
Tests:
a, b equality
a === b
a, b locale compare
a.localeCompare(b) === 0
a, c equality
a === c
a, c locale compare
a.localeCompare(c) === 0