MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / benchmark

Function benchmark

test/nodejs/benchmark.js:36–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36async function benchmark() {
37 // warmup
38 await route(waypoints);
39
40 const performanceHistorgram = createHistogram();
41
42 for (let i = 0; i < 1000; i++) {
43 const start = performance.now();
44 await route(waypoints);
45 const end = performance.now();
46 // record result in microseconds
47 performanceHistorgram.record(Math.ceil((end - start) * 1000));
48 }
49
50
51 console.log(performanceHistorgram);
52}
53benchmark();

Callers 1

benchmark.jsFile · 0.70

Calls 1

routeFunction · 0.70

Tested by

no test coverage detected