EmilStenstrom/justhtml-migration

★ 2Forks 0PythonGitHub ↗Compare

README

justhtml-migration benchmark

One-off benchmark harness to compare:

  • JustHTML(html).to_markdown()
  • BeautifulSoup(html, "lxml").get_text() with a small newline cleanup

Setup

Install dependencies (recommended: use a virtualenv):

python3 -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt

If python -m venv fails on Debian/Ubuntu, install python3-venv and retry.

Run benchmark (synthetic Outlook-like emails)

python benchmark.py --n 100 --rounds 20

To run only one engine:

python benchmark.py --engine justhtml --n 100 --rounds 20
python benchmark.py --engine bs4 --n 100 --rounds 20

Run benchmark (your real exported Outlook emails)

Put exported .html emails in a directory and run:

python benchmark.py --dir /path/to/htmls --n 100 --rounds 20

Notes:

  • Only the first --n files (sorted by filename) are used.
  • JustHTML output is Markdown; bs4 output is plain text.

Contributors

EmilStenstrom

Issues