Skip to content

Commit 6cb2b87

Browse files
committed
perf(dash-wasm): read MPDs with a larger buffer
1 parent 1688d3c commit 6cb2b87

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/parsers/manifest/dash/wasm-parser/rs/lib.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ mod utils;
1010

1111
pub use errors::{ParsingError, Result};
1212

13+
const READER_CAPACITY: usize = 32 * 1024;
14+
1315
use events::*;
1416
use processor::MPDProcessor;
1517
use reader::MPDReader;
@@ -80,7 +82,7 @@ extern "C" {
8082

8183
#[no_mangle]
8284
pub extern "C" fn parse() {
83-
let buf_read = BufReader::new(MPDReader {});
85+
let buf_read = BufReader::with_capacity(READER_CAPACITY, MPDReader {});
8486
let mut processor = MPDProcessor::new(buf_read);
8587
processor.process_tags();
8688
}

‎src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import ParsersStack from "./parsers_stack.ts";
3636
import type { AttributeName, TagName } from "./types.ts";
3737
import { CustomEventType } from "./types.ts";
3838

39-
const MAX_READ_SIZE = 15e3;
39+
const MAX_READ_SIZE = 32 * 1024;
4040

4141
export default class DashWasmParser {
4242
/**

0 commit comments

Comments
 (0)