test(performance): add formal M3U import benchmark (#1287)

* test(performance): add formal M3U import benchmark

* test(performance): harden formal capture validity

* test(performance): address benchmark review feedback
This commit is contained in:
4gray authored and GitHub committed 2026-07-27 10:34:22 +02:00
1 parent 26331676f9
commit 24f0dee6f0
80 files changed
+11131 -192

No files matched your search

@@ -0,0 +1,53 @@
export const PERFORMANCE_PHASE_BOUNDARY = {
END: 'end',
START: 'start',
} as const;
export type PerformancePhaseBoundary =
(typeof PERFORMANCE_PHASE_BOUNDARY)[keyof typeof PERFORMANCE_PHASE_BOUNDARY];
export const M3U_IMPORT_PERFORMANCE_PHASE_EVENT_CHANNEL =
'IPTVNATOR_M3U_IMPORT_PERFORMANCE_PHASE_EVENT';
export const M3U_IMPORT_PERFORMANCE_PHASE = {
DATA_ACQUIRE: 'data.acquire',
NORMALIZE: 'normalize',
PARSE_M3U: 'parse.m3u',
} as const;
export type M3uImportPerformancePhase =
(typeof M3U_IMPORT_PERFORMANCE_PHASE)[keyof typeof M3U_IMPORT_PERFORMANCE_PHASE];
export const APP_PLAYLIST_UPSERT_PERFORMANCE_PHASE = {
SERIALIZE_PLAYLIST: 'serialize.playlist',
SQLITE_WRITE: 'sqlite.write',
} as const;
export type AppPlaylistUpsertPerformancePhase =
(typeof APP_PLAYLIST_UPSERT_PERFORMANCE_PHASE)[keyof typeof APP_PLAYLIST_UPSERT_PERFORMANCE_PHASE];
export const APP_PLAYLIST_GET_PERFORMANCE_PHASE = {
DESERIALIZE_PLAYLIST: 'deserialize.playlist',
SQLITE_READ: 'sqlite.read',
} as const;
export type AppPlaylistGetPerformancePhase =
(typeof APP_PLAYLIST_GET_PERFORMANCE_PHASE)[keyof typeof APP_PLAYLIST_GET_PERFORMANCE_PHASE];
export type AppPlaylistPerformancePhase =
| AppPlaylistGetPerformancePhase
| AppPlaylistUpsertPerformancePhase;
export interface PerformancePhaseMetadata {
readonly byteCount?: number;
readonly itemCount?: number;
}
export interface PerformancePhaseEvent<TPhase extends string = string> {
readonly boundary: PerformancePhaseBoundary;
readonly durationMs: number | null;
readonly epochMs: number;
readonly metadata?: PerformancePhaseMetadata;
readonly phase: TPhase;
readonly requestId: string;
}