minotor 11.0.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,6 @@
1
- # [11.0.0](https://github.com/aubryio/minotor/compare/v10.1.0...v11.0.0) (2026-04-13)
1
+ # [11.1.0](https://github.com/aubryio/minotor/compare/v11.0.0...v11.1.0) (2026-04-15)
2
2
 
3
3
 
4
- ### Performance Improvements
4
+ ### Features
5
5
 
6
- * use plain numbers to represent times and durations ([#61](https://github.com/aubryio/minotor/issues/61)) ([b72cc6d](https://github.com/aubryio/minotor/commit/b72cc6d2ed7c0ccabc6b0c0c0c0c1e07fd4b77be))
7
-
8
-
9
- ### BREAKING CHANGES
10
-
11
- * new protobuf format and versioning scheme incompatible with earlier versions of the
12
- library.
6
+ * basic GTFS frequency.txt support (scheduled only) ([#63](https://github.com/aubryio/minotor/issues/63)) ([05cf559](https://github.com/aubryio/minotor/commit/05cf559cd34ba336dae7f35e9eb7901ae23ea7b4)), closes [#50](https://github.com/aubryio/minotor/issues/50)
@@ -1,28 +1,66 @@
1
1
  import { Query, Router, StopsIndex } from '../router.js';
2
2
  type PerformanceResult = {
3
3
  task: Query;
4
- meanTimeMs: number;
4
+ meanTimeUs: number;
5
5
  meanMemoryMb: number;
6
6
  };
7
7
  /**
8
+ * Loads a list of routing queries from a JSON file and resolves the
9
+ * human-readable stop IDs to the internal numeric IDs used by the router.
8
10
  *
9
- * @param filePath
10
- * @returns
11
+ * The file must contain a JSON array whose elements each have the shape:
12
+ * ```json
13
+ * { "from": "STOP_A", "to": ["STOP_B", "STOP_C"], "departureTime": "08:30:00" }
14
+ * ```
15
+ * An optional `maxTransfers` integer field is also supported.
16
+ *
17
+ * @param filePath - Path to the JSON file containing the serialized queries.
18
+ * @param stopsIndex - The stops index used to resolve source stop IDs to the
19
+ * internal numeric IDs expected by the router.
20
+ * @returns An array of fully constructed {@link Query} objects ready to be
21
+ * passed to {@link Router.route}.
22
+ * @throws If the file cannot be read, the JSON is malformed, or any stop ID
23
+ * referenced in the file cannot be found in the stops index.
11
24
  */
12
25
  export declare const loadQueriesFromJson: (filePath: string, stopsIndex: StopsIndex) => Query[];
13
26
  /**
27
+ * Benchmarks {@link Router.route} across a set of queries.
14
28
  *
15
- * @param router
16
- * @param stopsIndex
17
- * @param tasks
18
- * @param iterations
19
- * @returns
29
+ * @param router - The router instance to benchmark.
30
+ * @param tasks - The list of queries to run. One {@link PerformanceResult} is
31
+ * produced per query.
32
+ * @param iterations - Number of times each query is repeated. Higher values
33
+ * yield a more stable mean at the cost of longer wall-clock time.
34
+ * @returns An array of {@link PerformanceResult} objects, one per query, each
35
+ * containing the mean wall-clock time (µs) and mean heap delta (MB).
20
36
  */
21
37
  export declare const testRouterPerformance: (router: Router, tasks: Query[], iterations: number) => PerformanceResult[];
22
38
  /**
39
+ * Benchmarks {@link Result.bestRoute} — the path-reconstruction phase —
40
+ * independently of the routing phase.
41
+ *
42
+ * @param router - The router instance used to produce the routing results that
43
+ * are then fed into `bestRoute`.
44
+ * @param tasks - The list of queries to benchmark. One {@link PerformanceResult}
45
+ * is produced per query.
46
+ * @param iterations - Number of times `bestRoute` is called per query.
47
+ * @returns An array of {@link PerformanceResult} objects, one per query, each
48
+ * containing the mean wall-clock time (µs) and mean heap delta (MB) for the
49
+ * `bestRoute` call alone.
50
+ */
51
+ export declare const testBestRoutePerformance: (router: Router, tasks: Query[], iterations: number) => PerformanceResult[];
52
+ /**
53
+ * Prints a human-readable summary of performance results to stdout.
54
+ *
55
+ * Displays an overall mean across all tasks followed by a per-task breakdown.
56
+ * An optional {@link label} is printed as a section header so that results
57
+ * from different benchmark phases (e.g. routing vs. reconstruction) can be
58
+ * told apart when several calls appear in the same run.
23
59
  *
24
- * @param results
25
- * @returns
60
+ * @param results - The performance results to display, as returned by
61
+ * {@link testRouterPerformance} or {@link testBestRoutePerformance}.
62
+ * @param label - Optional heading printed above the results block.
63
+ * Defaults to `'Performance Results'`.
26
64
  */
27
- export declare const prettyPrintPerformanceResults: (results: PerformanceResult[]) => void;
65
+ export declare const prettyPrintPerformanceResults: (results: PerformanceResult[], label?: string) => void;
28
66
  export {};