Upgrade grape-path-helpers to 1.7.0
What does this MR do?
This brings in the performance improvement in https://gitlab.com/gitlab-org/grape-path-helpers/-/merge_requests/38
Testing locally
Without this patch:
[1] pry(main)> class Helpers
[1] pry(main)* include GrapePathHelpers::NamedRouteMatcher
[1] pry(main)* end
=> Helpers
[2] pry(main)> helpers = Helpers.new
=> #<Helpers:0x00007f88b6cf3a78>
[3] pry(main)> puts Benchmark.measure { helpers.api_v4_projects_path(id: 5) }
2.373852 0.032682 2.406534 ( 2.406481)
=> nil
[4] pry(main)> puts Benchmark.measure { 10_000.times { helpers.api_v4_projects_path(id: 5) } }
3.920357 0.004969 3.925326 ( 3.925379)
=> nil
[5] pry(main)> puts Benchmark.measure { 10_000.times { helpers.api_v4_projects_path(id: 5) } }
3.906761 0.016464 3.923225 ( 3.923381)
=> nil
[6] pry(main)> puts Benchmark.measure { 10_000.times { helpers.api_v4_projects_path(id: 5) } }
3.897988 0.004267 3.902255 ( 3.902425)
=> nil
With this patch:
[1] pry(main)> class Helpers
[1] pry(main)* include GrapePathHelpers::NamedRouteMatcher
[1] pry(main)* end
=> Helpers
[2] pry(main)> helpers = Helpers.new
=> #<Helpers:0x00007fc600f42a68>
[3] pry(main)> puts Benchmark.measure { helpers.api_v4_projects_path(id: 5) }
2.374689 0.044254 2.418943 ( 2.411916)
=> nil
[4] pry(main)> puts Benchmark.measure { 10_000.times { helpers.api_v4_projects_path(id: 5) } }
0.144653 0.012070 0.156723 ( 0.156732)
=> nil
[5] pry(main)> puts Benchmark.measure { 10_000.times { helpers.api_v4_projects_path(id: 5) } }
0.143720 0.000000 0.143720 ( 0.143721)
=> nil
[6] pry(main)> puts Benchmark.measure { 10_000.times { helpers(.api_v4_projects_path(id: 5) } }
0.142390 0.000000 0.142390 ( 0.142401)
=> nil
(First call is slow because that loads the routes and memoizes them)
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Edited by Heinrich Lee Yu