pry-auto_benching.rb 2.10.4 → 2.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -4
- data/README.md +16 -35
- data/lib/pry-auto_benching/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7b0dc93c3c15661860a761a020191729d6e8f13df4d1c731b61fd1cdfc16fc0
|
4
|
+
data.tar.gz: 1b9f167f1539ef38333f5b8eaeb4f9917669f194cf1269032184349f785ae362
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce5c18e18229ae2869e626aa8fc4365aee3e191a3ca7c83a4491ef9fa0d4c12a714ba43b1dfc6082b5f4f5e231cc420ec915e4b890f0e0a84bd91e81ac79f322
|
7
|
+
data.tar.gz: 43bc389c8483039f6272b9835d8cc6ad8a388682440fd2bc6ac9f33247febcdbb9120d8e70ae9b74ac48b224172dabef0e9e93b4445a0d191f4420876fd45bf7
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v2.10.5
|
4
|
+
|
5
|
+
* Doc updates
|
6
|
+
|
3
7
|
## v2.10.4
|
4
8
|
|
5
|
-
*
|
9
|
+
* Doc updates
|
6
10
|
|
7
11
|
## v2.10.3
|
8
12
|
|
9
|
-
*
|
13
|
+
* Doc updates
|
10
14
|
|
11
15
|
## v2.10.2
|
12
16
|
|
@@ -29,8 +33,8 @@
|
|
29
33
|
|
30
34
|
## v2.9.0
|
31
35
|
|
32
|
-
* Add '--target-display' option (shorthand: '-t') to the `auto-benching` command.
|
33
|
-
|
36
|
+
* Add '--target-display' option (shorthand: '-t') to the `auto-benching` command.
|
37
|
+
The option is for changing where benchmark results are written to.
|
34
38
|
|
35
39
|
* Accept 'output' and 'prompt' as valid values for `Pry.config.auto_benching.target_display`,
|
36
40
|
in addition to the already accepted values `:output` and `:prompt`.
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
* <a href='#configuration'>Configuration (optional)</a>
|
5
5
|
* <a href='#examples'>Examples</a>
|
6
6
|
* <a href='#accuracy'>Accuracy</a>
|
7
|
-
* <a href='#custom-prompts'>Custom prompts</a>
|
8
7
|
* <a href='#install'>Install</a>
|
9
8
|
* <a href='#license'>License</a>
|
10
9
|
|
@@ -14,9 +13,9 @@ pry-auto_benching.rb automates benchmarking inside the Pry REPL.
|
|
14
13
|
|
15
14
|
## <a id='configuration'>Configuration (optional)</a>
|
16
15
|
|
17
|
-
Configuration
|
18
|
-
To change the defaults, open `~/.pryrc`
|
19
|
-
following:
|
16
|
+
Configuration can be skipped unless you want to change the defaults. <br>
|
17
|
+
To change the defaults, open `~/.pryrc` in your editor of choice and change
|
18
|
+
one or more of the following:
|
20
19
|
|
21
20
|
```ruby
|
22
21
|
Pry.configure do |config|
|
@@ -81,7 +80,7 @@ end
|
|
81
80
|
|
82
81
|
__1.__
|
83
82
|
|
84
|
-
|
83
|
+
Get started by reading the help menu:
|
85
84
|
|
86
85
|
Usage: auto-benching [options] [enable|disable]
|
87
86
|
|
@@ -95,7 +94,8 @@ Display help by running `auto-benching -h`:
|
|
95
94
|
|
96
95
|
__2.__
|
97
96
|
|
98
|
-
|
97
|
+
In this example, the prompt is updated with benchmark results.
|
98
|
+
This also happens to be the default behavior.
|
99
99
|
|
100
100
|
[7] pry(main)> sleep 0.2
|
101
101
|
=> 0
|
@@ -107,7 +107,7 @@ The prompt is updated with benchmark results (default behavior).
|
|
107
107
|
|
108
108
|
__3.__
|
109
109
|
|
110
|
-
`_pry_.output` is updated with benchmark results.
|
110
|
+
In this example, `_pry_.output` is updated with benchmark results.
|
111
111
|
|
112
112
|
[6] pry(main)> auto-benching --target-display output
|
113
113
|
Display changed to 'output'
|
@@ -123,8 +123,8 @@ __3.__
|
|
123
123
|
|
124
124
|
__4.__
|
125
125
|
|
126
|
-
|
127
|
-
|
126
|
+
In this example, `auto-benching --past` is used to view past benchmark
|
127
|
+
results.
|
128
128
|
|
129
129
|
[6] 0.5s (main)> auto-benching --past
|
130
130
|
1. Net::HTTP.get_response URI.parse('https://github.com') (0.88s)
|
@@ -135,8 +135,7 @@ Display a history of benchmark results for the current Pry session by running
|
|
135
135
|
|
136
136
|
__5.__
|
137
137
|
|
138
|
-
|
139
|
-
`auto-benching disable`:
|
138
|
+
In this example, benchmarking is disabled for the current Pry session:
|
140
139
|
|
141
140
|
[5] pry(main)> auto-benching disable
|
142
141
|
pry-auto_benching.rb: stopped benchmarking.
|
@@ -144,36 +143,18 @@ Disable auto benchmarking for the current Pry session by running
|
|
144
143
|
|
145
144
|
## <a id='accuracy'>Accuracy</a>
|
146
145
|
|
147
|
-
pry-auto_benching.rb can measure down to 10 milliseconds (0.01 =
|
148
|
-
|
146
|
+
pry-auto_benching.rb can measure down to 10 milliseconds (0.01 = 10ms).
|
147
|
+
When I benchmarked `sleep 0.01` I saw no overhead in the results:
|
149
148
|
|
150
149
|
[1] pry(main)> sleep 0.01
|
151
150
|
=> 0
|
152
151
|
[2] 0.01s (main)>
|
153
152
|
|
154
|
-
But
|
155
|
-
includes a **very** small number of method calls to Pry internals, and it could
|
156
|
-
include time spent by other Pry plugins who run before/after eval hooks as well.
|
157
|
-
I have seen inaccuracies of 10ms (0.01) but not all the time.
|
153
|
+
But that's not to say results can't be reported inaccurately since the benchmark
|
154
|
+
includes a **very** small number of method calls to Pry internals, and it could
|
155
|
+
include time spent by other Pry plugins who run before/after eval hooks as well.
|
156
|
+
I have seen inaccuracies of 10ms (0.01) but not all the time.
|
158
157
|
|
159
|
-
## <a id='custom-prompts'>Custom prompts</a>
|
160
|
-
|
161
|
-
If you want a custom prompt to integrate with pry-auto_benching.rb, it's easy, simply use
|
162
|
-
`pry.config.prompt_name` (by default it is equal to 'pry') somewhere in the prompt and the
|
163
|
-
duration of a benchmark will be inserted in its place, as long as `auto_benching.target_display`
|
164
|
-
is set to `prompt`.
|
165
|
-
|
166
|
-
Example:
|
167
|
-
|
168
|
-
```ruby
|
169
|
-
Pry::Prompt.add(
|
170
|
-
:some_prompt,
|
171
|
-
'description of some_prompt',
|
172
|
-
%w[> *]
|
173
|
-
) do |target, nestlevel, pry, sep|
|
174
|
-
"#{pry.config.prompt_name}#{sep} "
|
175
|
-
end
|
176
|
-
```
|
177
158
|
|
178
159
|
## <a id='install'>Install</a>
|
179
160
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-auto_benching.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.10.
|
4
|
+
version: 2.10.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Gleeson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|