Skip to content

Commit

Permalink
docs: update guides and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aristotelesbr committed Jan 9, 2024
1 parent 8b6fe55 commit 49fa750
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 13 deletions.
39 changes: 39 additions & 0 deletions guides/performance/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Performance

The **Lennarb** is very fast. The following benchmarks were performed on a MacBook Pro (Retina, 13-inch, Early 2013) with 2,7 GHz Intel Core i7 and 8 GB 1867 MHz DDR3. Based on [jeremyevans/r10k](https://github.com/jeremyevans/r10k) using the following [template build](static/r10k/build/lennarb.rb).

All tests are performed using the **Ruby 3.3.0**

### Requests per second (RPS) - Dinamic routes

<p>
<img src="static/rps.png" alt="Benchmarks" width="100%">
</p>

### Memory usage

<p>
<img src="static/memory.png" alt="Benchmarks" width="100%">
</p>

### Runtime startup

<p>
<img src="static/runtime_with_startup.png" alt="Benchmarks" width="100%">
</p>

## Best numbers

| Framework | RPS | Memory usage | Runtime startup |
| ---------- | --- | ------------ | --------------- |
| Lennarb | 1 | 1 | 1 |
| Roda | 2 | 2 | 2 |
| Syro | 3 | 3 | 3 |
| Hanami-API | 5 | 5 | 5 |
| Sinatra | 6 | 6 | 6 |
| Rails | 7 | 6 | 6 |

## Conclusion

These numbers are just a small reference, **Lennarb** is not a framework, it is a router. In my opinion, **Roda** is the best router for Ruby because it has many interesting features, such as a middleware manager, and very good development performance.

20 changes: 7 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,25 @@ To use Lennarb is very simple, just create a instance of `Lennarb` and use the m
app = Lennarb.new

app.get("/hello/:name") do |req, res|
res.html("Hello #{params[:name]}")
name = req.params[:name]

res.html("Hello #{name}")
end
```

## Performance
To more examples of usage see [getting started](https://aristotelesbr.github.io/lennarbguides/getting-started/index) documentation.

The **Lennarb** is very fast. The following benchmarks were performed on a MacBook Pro (Retina, 13-inch, Early 2013) with 2,7 GHz Intel Core i7 and 8 GB 1867 MHz DDR3. Based on [jeremyevans/r10k](https://github.com/jeremyevans/r10k) using the following [template build](static/r10k/build/lennarb.rb).
## Performance

### Requests per second (RPS) - Dinamic routes

<p>
<img src="static/rps.png" alt="Benchmarks" width="100%">
</p>

### Memory usage
To more details about the benchmarks, please see the [project documentation](https://aristotelesbr.github.io/lennarb/performance/index).

<p>
<img src="static/memory.png" alt="Benchmarks" width="100%">
</p>

### Runtime startup

<p>
<img src="static/runtime_with_startup.png" alt="Benchmarks" width="100%">
</p>
## Documentation

Please see the [project documentation](https://aristotelesbr.github.io/lennarb) for more details.

Expand Down

0 comments on commit 49fa750

Please sign in to comment.