Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
Update table
Browse files Browse the repository at this point in the history
  • Loading branch information
binarylogic committed Aug 21, 2016
1 parent aad565a commit c135702
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Timber was designed with an obsessive focus on performance and resource usage. I
The following results were run on a bare metal server in order to achieve consistent and repeatable results.

```console
+---------------------------+------------+-----------------+------------------+--------------+
| Timber benchmarking. 10 requests per test. Times are "real" CPU time. |
+---------------------------+------------+-----------------+------------------+--------------+
| | Total | Per request avg | Per request diff | Per log line |
+---------------------------+------------+-----------------+------------------+--------------+
| Control | 0.00614905 | 0.00061491 | | 2.05e-05 |
| Timber probes only | 0.00667906 | 0.00066791 | 5.3e-05 | 2.226e-05 |
| Timber probes and logging | 0.01047921 | 0.00104792 | 0.00038002 | 3.493e-05 |
+---------------------------+------------+-----------------+------------------+--------------+
+---------------------------+------------+-----------------+--------------+
| Timber benchmarking. 10 requests per test. Times are "real" CPU time. |
+---------------------------+------------+-----------------+--------------+
| | Total | Per request avg | Per log line |
+---------------------------+------------+-----------------+--------------+
| Control | 0.0077939 | 0.00077939 | 2.598e-05 |
| Timber probes only | 0.00694394 | 0.00069439 | 2.315e-05 |
| Timber probes and logging | 0.00897193 | 0.00089719 | 2.991e-05 |
+---------------------------+------------+-----------------+--------------+
```

1. `Control` - This is vanilla rails app without Timber installed.
Expand Down
8 changes: 4 additions & 4 deletions benchmark/rails_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def line_count(io)

title = "Timber benchmarking. #{ITERATIONS} requests per test. Times are \"real\" CPU time."
table = Terminal::Table.new(:title => title) do |t|
t << [nil, "Total", "Per request avg", "Per request diff", "Per log line"]
t << [nil, "Total", "Per request avg", "Per log line"]
t.add_separator
t << [control.label, control.real.round(PRECISION), control_per_req.round(PRECISION), nil, control_per_line.round(PRECISION)]
t << [probes_only.label, probes_only.real.round(PRECISION), probes_only_per_req.round(PRECISION), probes_only_per_req_diff.round(PRECISION), probes_only_per_line.round(PRECISION)]
t << [with_timber.label, with_timber.real.round(PRECISION), with_timber_per_req.round(PRECISION), with_timber_per_req_diff.round(PRECISION), with_timber_per_line.round(PRECISION)]
t << [control.label, control.real.round(PRECISION), control_per_req.round(PRECISION), control_per_line.round(PRECISION)]
t << [probes_only.label, probes_only.real.round(PRECISION), probes_only_per_req.round(PRECISION), probes_only_per_line.round(PRECISION)]
t << [with_timber.label, with_timber.real.round(PRECISION), with_timber_per_req.round(PRECISION), with_timber_per_line.round(PRECISION)]
end
puts table

0 comments on commit c135702

Please sign in to comment.