From 8a2ac942431098c38755c19846e89b00d3c7178f Mon Sep 17 00:00:00 2001 From: Karim shoair Date: Wed, 26 Mar 2025 05:41:03 +0200 Subject: [PATCH] docs: Updating the benchmarks table with current numbers All libraries are updated to the latest version --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7353659..40926c7 100644 --- a/README.md +++ b/README.md @@ -161,25 +161,25 @@ Here are benchmarks comparing Scrapling to popular Python libraries in two tests | # | Library | Time (ms) | vs Scrapling | |---|:-----------------:|:---------:|:------------:| -| 1 | Scrapling | 5.44 | 1.0x | -| 2 | Parsel/Scrapy | 5.53 | 1.017x | -| 3 | Raw Lxml | 6.76 | 1.243x | -| 4 | PyQuery | 21.96 | 4.037x | -| 5 | Selectolax | 67.12 | 12.338x | -| 6 | BS4 with Lxml | 1307.03 | 240.263x | -| 7 | MechanicalSoup | 1322.64 | 243.132x | -| 8 | BS4 with html5lib | 3373.75 | 620.175x | +| 1 | Scrapling | 5.55 | 1.0x | +| 2 | Parsel/Scrapy | 5.67 | 1.022x | +| 3 | Raw Lxml | 6.69 | 1.205x | +| 4 | PyQuery | 20.84 | 3.755x | +| 5 | Selectolax | 84.41 | 15.209x | +| 6 | BS4 with Lxml | 1313.45 | 236.658x | +| 7 | MechanicalSoup | 1313.66 | 236.695x | +| 8 | BS4 with html5lib | 3383.27 | 609.598x | -As you see, Scrapling is on par with Scrapy and slightly faster than Lxml which both libraries are built on top of. These are the closest results to Scrapling. PyQuery is also built on top of Lxml but still, Scrapling is 4 times faster. +As you see, Scrapling is on par with Scrapy and slightly faster than Lxml which both libraries are built on top of. These are the closest results to Scrapling. PyQuery is also built on top of Lxml but still, Scrapling is ~4 times faster. ### Extraction By Text Speed Test | Library | Time (ms) | vs Scrapling | |:-----------:|:---------:|:------------:| -| Scrapling | 2.51 | 1.0x | -| AutoScraper | 11.41 | 4.546x | +| Scrapling | 2.35 | 1.0x | +| AutoScraper | 11.44 | 4.868x | -Scrapling can find elements with more methods and it returns full element `Adaptor` objects not only the text like AutoScraper. So, to make this test fair, both libraries will extract an element with text, find similar elements, and then extract the text content for all of them. As you see, Scrapling is still 4.5 times faster at the same task. +Scrapling can find elements with more methods and it returns full element `Adaptor` objects not only the text like AutoScraper. So, to make this test fair, both libraries will extract an element with text, find similar elements, and then extract the text content for all of them. As you see, Scrapling is still 4.8 times faster at the same task. > All benchmarks' results are an average of 100 runs. See our [benchmarks.py](https://github.com/D4Vinci/Scrapling/blob/main/benchmarks.py) for methodology and to run your comparisons.