Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubocop/rubocop-performance
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.24.0
Choose a base ref
...
head repository: rubocop/rubocop-performance
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.25.0
Choose a head ref
  • 14 commits
  • 25 files changed
  • 3 contributors

Commits on Feb 15, 2025

  1. Configuration menu
    Copy the full SHA
    73fecfd View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2025

  1. Enable InternalAffairs/CopEnabled cop

    Since #490 made RuboCop 1.72+ a runtime requirement, `cop_enabled?` can now be used.
    koic committed Feb 18, 2025
    Configuration menu
    Copy the full SHA
    197472c View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2025

  1. [Fix #482] Change Performance/CollectionLiteralInLoop to not regist…

    …er offenses for `Array#include?` that are optimized directly in Ruby.
    
    Since `include?` on arrays are the only instances I ever run across this cop, I think it makes sense to add special handling for this.
    
    On Ruby 3.4 this does no array allocations:
    ```
    require "memory_profiler"
    
    class Foo
      def bar
        Bar.new
      end
    end
    
    class Bar
      def baz
      end
    end
    
    foo = Foo.new
    report = MemoryProfiler.report do
      [1,2].include?(foo.bar.baz)
    end.pretty_print
    ```
    
    Also, this code is simply slower on Ruby 3.4:
    
    ```rb
    require "benchmark/ips"
    
    local = [301, 302]
    val = 301
    Benchmark.ips do |x|
      x.report('local') do
        local.include?(val)
      end
    
      x.report('literal') do
        [301, 302].include?(val)
      end
      x.compare!
    end
    ```
    
    ```
    $ ruby test.rb
    ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
    Warming up --------------------------------------
                   local     1.822M i/100ms
                 literal     2.296M i/100ms
    Calculating -------------------------------------
                   local     18.235M (± 1.6%) i/s   (54.84 ns/i) -     92.906M in   5.096277s
                 literal     22.807M (± 1.5%) i/s   (43.85 ns/i) -    114.789M in   5.034289s
    
    Comparison:
                 literal: 22806932.0 i/s
                   local: 18235340.7 i/s - 1.25x  slower
    ```
    Earlopain committed Feb 25, 2025
    Configuration menu
    Copy the full SHA
    d196b53 View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2025

  1. Configuration menu
    Copy the full SHA
    5fa5f1a View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2025

  1. Merge pull request #488 from Earlopain/collection-literal-ruby34

    Change `Performance/CollectionLiteralInLoop` to not register offenses for `Array#include?` that are optimized directly in Ruby.
    koic authored Feb 27, 2025
    Configuration menu
    Copy the full SHA
    eb68f96 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2025

  1. Automate the process of GitHub release creation

    Follow-up to https://github.com/rubocop/rubocop/blob/master/.github/workflows/github_release.yml.
    
    This action will be triggered when a new tag is pushed and will
    auto-fill the release notes using the relevant file.
    
    The `rubocop-performance` repository has essentially the same structure as the `rubocop` repository,
    so it should work as is.
    koic committed Mar 2, 2025
    Configuration menu
    Copy the full SHA
    d842831 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2025

  1. [Fix #492] Fix false positives for `Performance/StringIdentifierArgum…

    …ent`
    
    This PR fixes false positives for `Performance/StringIdentifierArgument`
    when using interpolated string argument.
    Converting a string with interpolation into a symbol degrades performance.
    
    Fixes #492.
    koic committed Mar 7, 2025
    Configuration menu
    Copy the full SHA
    8c368f6 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2025

  1. Merge pull request #493 from koic/fix_false_positives_for_performance…

    …_string_identifier_argument
    
    [Fix #492] Fix false positives for `Performance/StringIdentifierArgument`
    koic authored Mar 8, 2025
    Configuration menu
    Copy the full SHA
    b6a39f4 View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2025

  1. Configuration menu
    Copy the full SHA
    d339b99 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #494 from dvandersluis/fixed-size-blocks

    Fix `Performance/FixedSize` false positive when `count` is called with a `numblock`
    koic authored Mar 20, 2025
    Configuration menu
    Copy the full SHA
    300b997 View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2025

  1. Support it block parameter in Performance cops

    This PR supports `it` block parameter in `Performance` cops.
    koic committed Mar 27, 2025
    Configuration menu
    Copy the full SHA
    cee374c View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2025

  1. Merge pull request #496 from koic/support_itblock_in_performance_cops

    Support `it` block parameter in `Performance` cops
    koic authored Mar 28, 2025
    Configuration menu
    Copy the full SHA
    9e5a10a View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2025

  1. Update Changelog

    koic committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    9bbcc52 View commit details
    Browse the repository at this point in the history
  2. Cut 1.25.0

    koic committed Apr 1, 2025
    Configuration menu
    Copy the full SHA
    1a7fa7c View commit details
    Browse the repository at this point in the history
Loading