Skip to content

Commit

Permalink
Merge pull request #2836 from neilvcarvalho/nc-update-monorepo-urls
Browse files Browse the repository at this point in the history
Update GitHub URLs to the RSpec monorepo
  • Loading branch information
JonRowe authored Feb 21, 2025
2 parents 77fdb4b + 74e6656 commit 94c4be4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,6 @@ you can run the specs and Cucumber features, or submit a pull request.
### RSpec base libraries

* https://github.com/rspec/rspec
* https://github.com/rspec/rspec-core
* https://github.com/rspec/rspec-expectations
* https://github.com/rspec/rspec-mocks

### Recommended third-party extensions

Expand Down
12 changes: 6 additions & 6 deletions benchmarks/before_block_capture_block_vs_yield.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def capture_block_and_call_n_times(n, &block)
example context.

rspec-core has already performed [many related benchmarks about
this](https://github.com/rspec/rspec-core/tree/main/benchmarks):
this](https://github.com/rspec/rspec/tree/main/rspec-core/benchmarks):

- [call vs yield](https://github.com/rspec/rspec-core/blob/main/benchmarks/call_v_yield.rb)
- [capture block vs yield](https://github.com/rspec/rspec-core/blob/main/benchmarks/capture_block_vs_yield.rb)
- [flat map vs inject](https://github.com/rspec/rspec-core/blob/main/benchmarks/flat_map_vs_inject.rb)
- [call vs yield](https://github.com/rspec/rspec/blob/main/rspec-core/benchmarks/call_v_yield.rb)
- [capture block vs yield](https://github.com/rspec/rspec/blob/main/rspec-core/benchmarks/capture_block_vs_yield.rb)
- [flat map vs inject](https://github.com/rspec/rspec/blob/main/rspec-core/benchmarks/flat_map_vs_inject.rb)

The results are very interesting:

Expand All @@ -64,7 +64,7 @@ def capture_block_and_call_n_times(n, &block)
> See also `flat_map_vs_inject.rb`, which appears to contradict these
> results a little bit.
>
> -- https://github.com/rspec/rspec-core/blob/main/benchmarks/capture_block_vs_yield.rb#L83-L95
> -- https://github.com/rspec/rspec/blob/main/rspec-core/benchmarks/capture_block_vs_yield.rb#L83-L95

and

Expand All @@ -75,7 +75,7 @@ def capture_block_and_call_n_times(n, &block)
> version remains faster in my benchmarks here no matter how small
> I shrink the `words` array. I'm not sure why!
>
> -- https://github.com/rspec/rspec-core/blob/main/benchmarks/flat_map_vs_inject.rb#L37-L42
> -- https://github.com/rspec/rspec/blob/main/rspec-core/benchmarks/flat_map_vs_inject.rb#L37-L42

This seems to show that the error margin is enough to negate any benefit from
capturing the block initially. It also shows that not capturing the block is
Expand Down

0 comments on commit 94c4be4

Please sign in to comment.