Skip to content

Releases: markusmobius/rust-htmldate

RustHtmlDate v1.10.2

Choose a tag to compare

@markusmobius markusmobius released this 21 Sep 09:39

Changes

  • Add owned tree imports and TreeSource adapters for existing caller-owned DOMs.
  • Add from_tree_source extraction that borrows node strings and attributes instead of duplicating them.
  • Share the existing date algorithm between owned and borrowed storage, preserving date options, ordered attributes, serialization and caller data. Pruning state remains private to extraction.
  • Keep the saved-page fixture in the GitHub source tree while excluding it from Cargo packages; source CI runs the saved-page test explicitly.

Verification

  • Rust 1.98.1 on Windows x86_64 GNU: 22 active library tests, the saved-page reference test, doctest, formatting and strict all-target Clippy passed.
  • Existing owned APIs remain available. The README documents the released APIs and crates.io installation.
  • Also published as rust-htmldate 1.10.2. Install with cargo add rust-htmldate@1.10.2. The registry package resolves Rust-DateParser 1.4.7 and Rust-Dateutil 2.9.1 from crates.io; the Git source retains its pinned dependency revisions. The runtime source is identical.

RustHtmlDate v1.10.1

Choose a tag to compare

@markusmobius markusmobius released this 14 Sep 17:15

RustHtmlDate v1.10.1

RustHtmlDate is a native Rust implementation that aims to mirror the date-selection algorithm of Python htmldate, following the Python-qualified Go-HtmlDate implementation. Python is the behavioral reference: different selected dates under equivalent inputs and settings are bugs, not intentional Rust-specific behavior. This release follows Python htmldate 1.10.0 at b895282, with Python dateparser 1.4.3.

Highlights

  • Native publication and last-modified date extraction, with fast and extensive search modes and borrowed-document, HTML and reader APIs.
  • Updated Rust DateParser v1.4.7 and shared Rust Dateutil v2.9.1, including CPython-compatible ISO/timestamp handling.
  • Shared immutable DOM nodes with independent pruning flags, avoiding full-tree copies while preserving caller-owned documents.
  • Python-compatible precedence, Unicode digit handling, incomplete-date defaults, timezone-aware bounds, local Unix references and HTML repair.
  • No runtime Go/Python bridge, unsafe Rust or internal worker threads. Optional time/timezone extraction remains a Go-derived extension.

Python Compatibility

All 9,614 independently generated Python reference cases agree. The release benchmark also verified 4,000/4,000 Python matches through the reader API on the 1,000-page saved corpus across all four modes. These tests establish agreement on their inputs, not proof for arbitrary HTML or timezone environments. Matching Python means reproducing its date choices, not guaranteeing that every chosen date is the page's true publication date.

Performance

Median extraction time per 1,000 pre-parsed pages, measured on 2026-09-14 with 500 samples per engine/mode, eight untimed warmups and 4,000 fully interleaved timed passes. Current Go and Rust were measured together, and both include their DOM pruning improvements.

Mode Go v1.10.1, ms/1,000 pages Rust v1.10.1, ms/1,000 pages Go / Rust
Publication, fast 172.14 99.09 1.74x
Publication, extensive 582.37 203.82 2.86x
Last modified, fast 173.18 99.43 1.74x
Last modified, extensive 565.30 208.25 2.71x

AMD Ryzen AI 7 PRO 350, Linux/WSL2, one extraction caller pinned to CPU 2; Rust 1.98.1 with the standard release profile and Go 1.27.1 with default garbage collection and CGO disabled. Parsing, file loading, network access, result formatting and validation are outside the timer. Both engines use identical normalized inputs, UTC, fixed date bounds/reference time and their native DateParser v1.4.7/Dateutil v2.9.1 libraries. All timed output hashes matched between engines and remained stable. Ratios divide the two medians; above 1 means Rust takes less time. Results are corpus- and environment-dependent, not guaranteed production speedups or an isolated measurement of the pruning strategy.

Benchmark report | Methodology and reproduction

Usage

Requires Rust 1.98.1. Distributed as Git source, not through crates.io; no prebuilt executables are attached. Linux and Windows CI passed for the release commit.

[dependencies]
rust-htmldate = { git = "https://github.com/markusmobius/rust-htmldate", tag = "v1.10.1" }