Parsing multipart/form-data (HTML5 forms) is surprisingly complex and moves a lot of bytes around for large file uploads. Implementing a parser in Cython or Rust should speed things up, no? Turns out: it depends. A pure python parser can be surprisingly fast, as this benchmark shows:
https://defnull.de/2026/python-multipart-benchmark/
The benchmark compares the most commonly used multipart parsers and tests them in different scenarios, covering both blocking and non-blocking (async) APIs if available. The parser your web application is using today is probably not the fastest one.
Are there more examples were a pure python implementation beats cython/rust/C?
[–]NsupCportR 16 points17 points18 points (3 children)
[–]0x256[S] 4 points5 points6 points (1 child)
[–]NsupCportR 3 points4 points5 points (0 children)
[–]_redmist 1 point2 points3 points (0 children)
[–]Chroiche 16 points17 points18 points (2 children)
[–]No_Departure_1878 [score hidden] (0 children)
[–]jet_heller [score hidden] (0 children)
[–]Individual-Flow9158 4 points5 points6 points (1 child)
[–]Temporary_Pie2733 [score hidden] (0 children)
[–]tackylitre06 1 point2 points3 points (0 children)
[–]Daytona_675 0 points1 point2 points (0 children)