Optimize normalize_name
Optimize normalize_name

This is called on every render or template lookup.

    lookup_context = ActionController::Base.new.lookup_context
    normalize = lookup_context.method(:normalize_name)

    Benchmark.ips do |x|
      x.report "already normalized" do
        normalize.call("show", ["users"])
      end

      x.report "without prefixes" do
        normalize.call("users/show", [])
      end

      x.report "with prefixes in both arguments" do
        normalize.call("extra/show", ["users", "application"])
      end
    end

Before:

      already normalized      2.322M (± 0.5%) i/s -     11.615M in   5.003512s
        without prefixes      1.613M (± 0.7%) i/s -      8.076M in   5.007165s
    with prefixes in both arguments
                              1.020M (± 0.7%) i/s -      5.154M in   5.054101s

After:

      already normalized      3.740M (± 0.3%) i/s -     18.715M in   5.003477s
        without prefixes      2.197M (± 0.6%) i/s -     11.089M in   5.047800s
    with prefixes in both arguments
                              1.244M (± 0.9%) i/s -      6.246M in   5.020968s

BlakeWilliams/rails,yahonda/rails,Stellenticket/rails,rails/rails,BlakeWilliams/rails,Erol/rails,EmmaB/rails-1,kddeisz/rails,georgeclaghorn/rails,joonyou/rails,Envek/rails,Vasfed/rails,Edouard-chin/rails,MSP-Greg/rails,EmmaB/rails-1,esparta/rails,joonyou/rails,Erol/rails,MSP-Greg/rails,BlakeWilliams/rails,yahonda/rails,Edouard-chin/rails,kddeisz/rails,lcreid/rails,yawboakye/rails,Erol/rails,MSP-Greg/rails,lcreid/rails,Vasfed/rails,Envek/rails,yahonda/rails,yawboakye/rails,kmcphillips/rails,Stellenticket/rails,Edouard-chin/rails,lcreid/rails,Stellenticket/rails,rails/rails,georgeclaghorn/rails,MSP-Greg/rails,Erol/rails,esparta/rails,georgeclaghorn/rails,rails/rails,rails/rails,Edouard-chin/rails,Stellenticket/rails,georgeclaghorn/rails,yawboakye/rails,kddeisz/rails,kddeisz/rails,joonyou/rails,kmcphillips/rails,BlakeWilliams/rails,lcreid/rails,esparta/rails,kmcphillips/rails,Vasfed/rails,yawboakye/rails,kmcphillips/rails,yahonda/rails,Envek/rails,Envek/rails,Vasfed/rails,EmmaB/rails-1,esparta/rails,joonyou/rails