Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Add WebSocket server throughput bench (#2741)
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy authored Apr 5, 2023
1 parent 65e34d8 commit 4dbfc34
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
20 changes: 19 additions & 1 deletion routes/benchmarks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,31 @@ export default function Benchmarks({ url, data }: PageProps<Data>) {
? benchData.normalizedMaxLatency
: benchData.maxLatency}
yLabel="milliseconds"
yTickFormat={formatMsec}
yTickFormat={formatReqSec}
/>
<p class="mt-1">
Max latency during the same test used above for requests/second.
Smaller is better.
</p>
</div>
<div class="mt-8">
<a href="#ws-echo-throughput" id="ws-echo-throughput">
<h5 class="text-lg font-medium tracking-tight hover:underline">
WebSocket Server Throughput
</h5>
</a>{" "}
<BenchmarkChart
columns={normalized
? benchData.normalizedMsgPerSec
: benchData.msgPerSec}
yLabel="1k msg/sec"
yTickFormat={formatReqSec}
/>
<p class="mt-1">
Tests WebSocket server performance. 100 concurrent connections do as
many echo requests as possible. Bigger is better.
</p>
</div>
</div>
);
}
Expand Down
6 changes: 6 additions & 0 deletions utils/benchmark_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface BenchmarkRun {
thread_count?: BenchmarkVariantsResultSet;
throughput?: BenchmarkVariantsResultSet;
lsp_exec_time?: BenchmarkVariantsResultSet;
ws_msg_per_sec?: BenchmarkVariantsResultSet;
}

export type BenchmarkName = Exclude<keyof BenchmarkRun, "created_at" | "sha1">;
Expand Down Expand Up @@ -328,6 +329,8 @@ export interface BenchmarkData {
cargoDeps: Column[];
sha1List: string[];
lspExecTime: Column[];
msgPerSec: Column[];
normalizedMsgPerSec: Column[];
}

export function reshape(data: BenchmarkRun[]): BenchmarkData {
Expand All @@ -338,6 +341,7 @@ export function reshape(data: BenchmarkRun[]): BenchmarkData {

const normalizedReqPerSec = createNormalizedColumns(data, "req_per_sec");
const normalizedMaxLatency = createNormalizedColumns(data, "max_latency");
const normalizedMsgPerSec = createNormalizedColumns(data, "ws_msg_per_sec");

return {
execTime: createColumns(
Expand All @@ -353,6 +357,8 @@ export function reshape(data: BenchmarkRun[]): BenchmarkData {
throughput: createColumns(data, "throughput"),
reqPerSec: createColumns(data, "req_per_sec"),
normalizedReqPerSec,
msgPerSec: createColumns(data, "ws_msg_per_sec"),
normalizedMsgPerSec,
proxy: createColumns(data, "req_per_sec_proxy"),
maxLatency: createColumns(data, "max_latency"),
normalizedMaxLatency,
Expand Down

0 comments on commit 4dbfc34

Please sign in to comment.