Skip to content

Commit

Permalink
0.0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Nov 29, 2023
1 parent 97188f8 commit 5c16e8c
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 17 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ Use the crawl shortcut to get the page content and url.
```ts
import { crawl } from "@spider-rs/spider-rs";

const { links, pages } = new crawl("https://rsseau.fr");
const { links, pages } = await crawl("https://rsseau.fr");
console.log(pages);
```

## Benchmarks

Spider is about 1,000x (small websites) 10,000x (medium websites), and 100,000x (production grade websites) times faster than the popular crawlee library even with the node port performance hits.

```sh
----------------------
mac Apple M1 Max
Expand All @@ -125,7 +127,7 @@ Test url: `https://choosealicense.com` (small)
| | `libraries` |
| :-------------------------------- | :-------------------- |
| **`spider-rs: crawl 10 samples`** | `286ms`(✅ **1.00x**) |
| **`crawlee: crawl 10 samples`** | `1s` (✅ **1.00x**) |
| **`crawlee: crawl 10 samples`** | `1.7s` (✅ **1.00x**) |

Test url: `https://rsseau.fr` (medium)

Expand Down
4 changes: 4 additions & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
- [Crawl](./crawl.md)
- [Scrape](./scrape.md)
- [Cron Job](./cron-job.md)

# Benchmarks

- [Compare](./benchmarks.md)
36 changes: 36 additions & 0 deletions book/src/benchmarks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Benchmarks

The speed of Spider-RS ported compared to other tools.

Spider is about 1,000x (small websites) 10,000x (medium websites), and 100,000x (production grade websites) times faster than the popular crawlee library even with the node port performance hits.

```sh
----------------------
mac Apple M1 Max
10-core CPU
64 GB of RAM memory
1 TB of SSD disk space
-----------------------
```

Test url: `https://choosealicense.com` (small)

32 pages

| | `libraries` |
| :-------------------------------- | :-------------------- |
| **`spider-rs: crawl 10 samples`** | `286ms`(✅ **1.00x**) |
| **`crawlee: crawl 10 samples`** | `1.7s` (✅ **1.00x**) |

Test url: `https://rsseau.fr` (medium)

211 pages

| | `libraries` |
| :-------------------------------- | :-------------------- |
| **`spider-rs: crawl 10 samples`** | `2.5s` (✅ **1.00x**) |
| **`crawlee: crawl 10 samples`** | `75s` (✅ **1.00x**) |

The performance scales the larger the website and if throttling is needed.

Linux benchmarks are about 10x faster than macOS for spider-rs.
1 change: 1 addition & 0 deletions book/src/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const onPageEvent = (err: Error | null, value: NPage) => {
links.push(value);
};

// params in order event, background, and headless chrome
await website.crawl(onPageEvent);
console.log(website.getLinks());
```
2 changes: 1 addition & 1 deletion npm/android-arm-eabi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-android-arm-eabi",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"android"
Expand Down
2 changes: 1 addition & 1 deletion npm/android-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-android-arm64",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"android"
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-darwin-arm64",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-universal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-darwin-universal",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-darwin-x64",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion npm/freebsd-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-freebsd-x64",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"freebsd"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm-gnueabihf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-arm-gnueabihf",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-arm64-gnu",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-arm64-musl",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-x64-gnu",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-linux-x64-musl",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-arm64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-win32-arm64-msvc",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"win32"
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-ia32-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-win32-ia32-msvc",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"win32"
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs-win32-x64-msvc",
"version": "0.0.20",
"version": "0.0.21",
"repository": "https://github.com/spider-rs/spider-nodejs",
"os": [
"win32"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spider-rs/spider-rs",
"version": "0.0.20",
"version": "0.0.21",
"main": "index.js",
"types": "index.d.ts",
"napi": {
Expand Down

0 comments on commit 5c16e8c

Please sign in to comment.