Batch Mode: Start Once, Parse Many
AILANG Parse has a fixed start-up cost before parsing begins. In batch mode this happens once, and every file after that is parsed without it. Batch mode is the single biggest speed-up.
Batch (multiple files or folder)
# Pass multiple files
docparse *.docx *.pptx *.xlsx
# Or an entire folder
docparse ~/Documents/
# Both auto-enable batch mode
Start-up happens once, then each file takes milliseconds
Loop (pays start-up every time)
# Don't do this — each invocation
# recompiles all 38 modules
for f in *.docx; do
docparse "$f"
done
Start-up happens again for every file
The docparse CLI turns on batch mode by itself when you pass more than one file or a folder. No extra flags needed.
Turn Off Tracing
AILANG records a detailed trace of each run when OTEL_EXPORTER_OTLP_ENDPOINT or GOOGLE_CLOUD_PROJECT is set, and that slows parsing. The docparse CLI turns tracing off by default.
To turn tracing back on for debugging:
AILANG_NO_TRACE=0 docparse report.docx
CLI vs API Server
CLI (docparse)
Best for: batch processing folders, CI/CD pipelines, one-off conversions.
- Start-up cost paid once per batch
- No network round trip
- Reads local files directly
API Server
Best for: web apps, real-time parsing, multi-user access.
- The parser stays loaded between requests
- No start-up cost per request
- Each request takes only the time to parse
For a steady stream of documents, such as user uploads, the API server has no start-up cost per file. For batch jobs on local files, pass a folder to the CLI.
Single-File Start-Up
Parsing one file with docparse report.docx takes a fraction of a second, and most of that is start-up, not parsing. The time barely changes with file size for Office files. If you have more than one file, pass them together.
Quick Performance Tips
- Always batch. Pass folders or globs:
docparse ~/inbox/ordocparse *.docx *.xlsx - Use the
docparseCLI. It setsAILANG_NO_TRACE=1and turns on batch mode for you. - Use the API for real-time work. The parser stays loaded, so each request takes only the time to parse.
- Skip AI for Office files. DOCX, PPTX, XLSX and ODF files need no AI model. Images need
--ai. PDFs are read on your machine without AI by default; choose the AI backend only for scans. See PDF parsing.
Frequently Asked Questions
How fast is AILANG Parse compared to other document parsers?
Once the parser has started, each Office file takes milliseconds, so a folder of documents is done in about the time one file takes on its own. Parse times for every parser we test are recorded with the benchmark results.
Why is AILANG Parse slow on a single file?
Every run has a fixed start-up time before parsing begins. Batch mode pays it once: pass several files or a folder to docparse, and each extra file adds only milliseconds.
How do I enable batch mode in AILANG Parse?
The docparse CLI turns on batch mode by itself when you pass several files or a folder. Run docparse ~/Documents/ or docparse *.docx *.pptx. No flags needed.
What does AILANG_NO_TRACE do?
AILANG_NO_TRACE=1 turns off trace collection, which slows parsing when OpenTelemetry endpoints are configured. The docparse CLI sets it by default.