Update names and descriptions for benchmarks (#18430)
This commit is contained in:
parent
419a1f11a9
commit
ba08d60cb9
|
|
@ -4,10 +4,21 @@ namespace Wasm.Performance.Driver
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public BenchmarkDescriptor Descriptor { get; set; }
|
||||||
|
|
||||||
|
public string ShortDescription { get; set; }
|
||||||
|
|
||||||
public bool Success { get; set; }
|
public bool Success { get; set; }
|
||||||
|
|
||||||
public int NumExecutions { get; set; }
|
public int NumExecutions { get; set; }
|
||||||
|
|
||||||
public double Duration { get; set; }
|
public double Duration { get; set; }
|
||||||
|
|
||||||
|
public class BenchmarkDescriptor
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -76,9 +76,9 @@ namespace Wasm.Performance.Driver
|
||||||
output.Metadata.Add(new BenchmarkMetadata
|
output.Metadata.Add(new BenchmarkMetadata
|
||||||
{
|
{
|
||||||
Source = "BlazorWasm",
|
Source = "BlazorWasm",
|
||||||
Name = result.Name,
|
Name = result.Descriptor.Name,
|
||||||
ShortDescription = $"{result.Name} Duration",
|
ShortDescription = result.Name,
|
||||||
LongDescription = $"{result.Name} Duration",
|
LongDescription = result.Descriptor.Description,
|
||||||
Format = "n2"
|
Format = "n2"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ namespace Wasm.Performance.Driver
|
||||||
output.Metadata.Add(new BenchmarkMetadata
|
output.Metadata.Add(new BenchmarkMetadata
|
||||||
{
|
{
|
||||||
Source = "BlazorWasm",
|
Source = "BlazorWasm",
|
||||||
Name = "Publish size",
|
Name = "blazorwasm/publish-size",
|
||||||
ShortDescription = "Publish size (KB)",
|
ShortDescription = "Publish size (KB)",
|
||||||
LongDescription = "Publish size (KB)",
|
LongDescription = "Publish size (KB)",
|
||||||
Format = "n2",
|
Format = "n2",
|
||||||
|
|
@ -116,7 +116,7 @@ namespace Wasm.Performance.Driver
|
||||||
output.Metadata.Add(new BenchmarkMetadata
|
output.Metadata.Add(new BenchmarkMetadata
|
||||||
{
|
{
|
||||||
Source = "BlazorWasm",
|
Source = "BlazorWasm",
|
||||||
Name = "Publish size (compressed)",
|
Name = "blazorwasm/compressed-publish-size",
|
||||||
ShortDescription = "Publish size compressed app (KB)",
|
ShortDescription = "Publish size compressed app (KB)",
|
||||||
LongDescription = "Publish size - compressed app (KB)",
|
LongDescription = "Publish size - compressed app (KB)",
|
||||||
Format = "n2",
|
Format = "n2",
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,11 @@ group('App Startup', () => {
|
||||||
} finally {
|
} finally {
|
||||||
app.dispose();
|
app.dispose();
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
descriptor: {
|
||||||
|
name: "blazorwasm/time-to-first-ui",
|
||||||
|
description: "Time to render first UI (ms)"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -16,22 +16,47 @@ group('JSON handling', () => {
|
||||||
teardown(() => app.dispose());
|
teardown(() => app.dispose());
|
||||||
|
|
||||||
benchmark('Serialize 1kb', () =>
|
benchmark('Serialize 1kb', () =>
|
||||||
benchmarkJson(app, '#serialize-small', '#serialized-length', 935));
|
benchmarkJson(app, '#serialize-small', '#serialized-length', 935), {
|
||||||
|
descriptor: {
|
||||||
|
name: 'blazorwasm/jsonserialize-1kb',
|
||||||
|
description: 'Serialize JSON 1kb - Time in ms'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
benchmark('Serialize 340kb', () =>
|
benchmark('Serialize 340kb', () =>
|
||||||
benchmarkJson(app, '#serialize-large', '#serialized-length', 339803));
|
benchmarkJson(app, '#serialize-large', '#serialized-length', 339803), {
|
||||||
|
descriptor: {
|
||||||
|
name: 'blazorwasm/jsonserialize-340kb',
|
||||||
|
description: 'Serialize JSON 340kb - Time in ms'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
benchmark('Deserialize 1kb', () =>
|
benchmark('Deserialize 1kb', () =>
|
||||||
benchmarkJson(app, '#deserialize-small', '#deserialized-count', 5));
|
benchmarkJson(app, '#deserialize-small', '#deserialized-count', 5), {
|
||||||
|
descriptor: {
|
||||||
|
name: 'blazorwasm/jsondeserialize-1kb',
|
||||||
|
description: 'Deserialize JSON 1kb - Time in ms'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
benchmark('Deserialize 340kb', () =>
|
benchmark('Deserialize 340kb', () =>
|
||||||
benchmarkJson(app, '#deserialize-large', '#deserialized-count', 1365));
|
benchmarkJson(app, '#deserialize-large', '#deserialized-count', 1365), {
|
||||||
|
descriptor: {
|
||||||
|
name: 'blazorwasm/jsondeserialize-340kb',
|
||||||
|
description: 'Deserialize JSON 340kb - Time in ms'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
benchmark('Serialize 340kb (JavaScript)', () => {
|
benchmark('Serialize 340kb (JavaScript)', () => {
|
||||||
const json = JSON.stringify(largeObjectToSerialize);
|
const json = JSON.stringify(largeObjectToSerialize);
|
||||||
if (json.length !== 339803) {
|
if (json.length !== 339803) {
|
||||||
throw new Error(`Incorrect length: ${json.length}`);
|
throw new Error(`Incorrect length: ${json.length}`);
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
descriptor: {
|
||||||
|
name: 'blazorwasm/jsonserialize-javascript-340kb',
|
||||||
|
description: 'Serialize JSON 340kb using JavaScript - Time in ms'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
benchmark('Deserialize 340kb (JavaScript)', () => {
|
benchmark('Deserialize 340kb (JavaScript)', () => {
|
||||||
|
|
@ -39,6 +64,11 @@ group('JSON handling', () => {
|
||||||
if (parsed.name !== 'CEO - Subordinate 0') {
|
if (parsed.name !== 'CEO - Subordinate 0') {
|
||||||
throw new Error('Incorrect result');
|
throw new Error('Incorrect result');
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
descriptor: {
|
||||||
|
name: 'blazorwasm/jsondeserialize-javascript-340kb',
|
||||||
|
description: 'Deserialize JSON 340kb using JavaScript - Time in ms'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ class Benchmark extends EventEmitter {
|
||||||
this._group = group;
|
this._group = group;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this._fn = fn;
|
this._fn = fn;
|
||||||
this._options = options;
|
this._options = options || {};
|
||||||
this._state = { status: BenchmarkStatus.idle };
|
this._state = { status: BenchmarkStatus.idle };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,13 +205,23 @@ class Benchmark extends EventEmitter {
|
||||||
await this._group.runTeardown();
|
await this._group.runTeardown();
|
||||||
}
|
}
|
||||||
|
|
||||||
reportBenchmarkEvent(BenchmarkEvent.benchmarkCompleted, { 'name': this.name, success: true, numExecutions: this._state.numExecutions, duration: this._state.estimatedExecutionDurationMs });
|
reportBenchmarkEvent(BenchmarkEvent.benchmarkCompleted, {
|
||||||
|
name: this.name,
|
||||||
|
success: true,
|
||||||
|
numExecutions: this._state.numExecutions,
|
||||||
|
duration: this._state.estimatedExecutionDurationMs,
|
||||||
|
descriptor: this._options.descriptor
|
||||||
|
});
|
||||||
|
|
||||||
this._updateState({ status: BenchmarkStatus.idle });
|
this._updateState({ status: BenchmarkStatus.idle });
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
this._updateState({ status: BenchmarkStatus.error });
|
this._updateState({ status: BenchmarkStatus.error });
|
||||||
console.error(ex);
|
console.error(ex);
|
||||||
reportBenchmarkEvent(BenchmarkEvent.benchmarkError, { 'name': this.name, success: false });
|
reportBenchmarkEvent(BenchmarkEvent.benchmarkError, {
|
||||||
|
name: this.name,
|
||||||
|
success: false,
|
||||||
|
descriptor: this._options.descriptor
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,24 @@ group('Rendering list', () => {
|
||||||
app.dispose();
|
app.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
benchmark('Render 10 items', () => measureRenderList(app, 10));
|
benchmark('Render 10 items', () => measureRenderList(app, 10), {
|
||||||
benchmark('Render 100 items', () => measureRenderList(app, 100));
|
descriptor: {
|
||||||
benchmark('Render 1000 items', () => measureRenderList(app, 1000));
|
name: 'blazorwasm/render-10-items',
|
||||||
|
description: 'Time to render 10 item list (ms)'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
benchmark('Render 100 items', () => measureRenderList(app, 100), {
|
||||||
|
descriptor: {
|
||||||
|
name: 'blazorwasm/render-100-items',
|
||||||
|
description: 'Time to render 100 item list (ms)'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
benchmark('Render 1000 items', () => measureRenderList(app, 1000), {
|
||||||
|
descriptor: {
|
||||||
|
name: 'blazorwasm/render-1000-items',
|
||||||
|
description: 'Time to render 1000 item list (ms)'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@
|
||||||
"branchOrCommit": "blazor-wasm",
|
"branchOrCommit": "blazor-wasm",
|
||||||
"dockerfile": "src/Components/benchmarkapps/Wasm.Performance/dockerfile"
|
"dockerfile": "src/Components/benchmarkapps/Wasm.Performance/dockerfile"
|
||||||
},
|
},
|
||||||
|
"buildArguments": [
|
||||||
|
"gitBranch=blazor-wasm"
|
||||||
|
],
|
||||||
"waitForExit": true,
|
"waitForExit": true,
|
||||||
"readyStateText": "Application started."
|
"readyStateText": "Application started."
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue