Skip to content
代码片段 群组 项目
该项目从 https://gitlab.com/gitlab-org/gitlab.git 镜像。 拉取镜像更新于
  1. 3月 13, 2025
    • Kassio Borges's avatar
      Avoid creating Gitlab::Graphql::Authorize::FieldExtension::Redactor · 05cb8824
      Kassio Borges 创作于
      With the goal to reduce the number of objects created during a GraphQL
      call, the condition to initialize a
      `Gitlab::Graphql::Authorize::FieldExtension::Redactor`, the
      `Gitlab::Graphql::Authorize::FieldExtension::Redactor#active?`
      was extracted to
      the `Gitlab::Graphql::Authorize::FieldExtension#authorized?`.
      
      Local benchmark comparisons:
      
      * ips (iterations per second)
      ```
      Warming up --------------------------------------
                    master     1.000 i/100ms
              avoid_redact     1.000 i/100ms
      Calculating -------------------------------------
                    master      0.324 (± 0.0%) i/s     (3.08 s/i) -      4.000 in  12.343343s
              avoid_redact      0.326 (± 0.0%) i/s     (3.07 s/i) -      4.000 in  12.277845s
      
      Comparison:
              avoid_redact:        0.3 i/s
                    master:        0.3 i/s - 1.01x  slower
      ```
      
      * memory comsumption
      ```
      Calculating -------------------------------------
                    master   570.367M memsize (   807.319k retained)
                               3.385M objects (     2.032k retained)
                              50.000  strings (    50.000  retained)
              avoid_redact   569.443M memsize (   617.745k retained)
                               3.380M objects (     1.319k retained)
                              50.000  strings (    50.000  retained)
      
      Comparison:
              avoid_redact:  569442619 allocated
                    master:  570366893 allocated - 1.00x more
      ```
      
      Related to: https://gitlab.com/gitlab-org/gitlab/-/issues/521588
      05cb8824
  2. 3月 11, 2025
加载中