Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x-pack/filebeat/input/httpjson: remove concurrency from response processing #36493

Merged
merged 16 commits into from
Sep 6, 2023

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Sep 4, 2023

Proposed commit message

Replace concurrent code and locks with sequential processing using handler interface types to simplify data flow.

Post refactor clean up will happen in a follow-up PR.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • This PR is subtle. I recommend review by commit. It is a little wandery (I noticed some things a commit after I should have), but the logic of the progression is fairly straightforward if the changes are stepped through rather than swallowed whole.
  • Ignore linter complaints; they will be repaired in the follow-up.

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

Performance impact

The change here is not intended to be a performance improvement, but rather to improve the maintainability and correctness of the code. However, it's worth checking that it does not do too much harm in that regard. The following is a comparison of the parent of this set of changes and the change here.

On mac there is little to no change in the cpu bench performance of the package after the change and a small but consistent improvement in the memory bench performance. A single cpu bench does show a significant improvement, and this is consistent over runs, but is not an important bench and is probably just a weirdness.

goos: darwin
goarch: amd64
pkg: github.com/elastic/beats/v7/x-pack/filebeat/input/httpjson
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
                                                                                                        │   old.bench    │                new.bench                 │
                                                                                                        │     sec/op     │     sec/op      vs base                  │
Input/simple_GET_request-16                                                                                547.5µ ±  19%    523.0µ ±  27%        ~ (p=0.739 n=10)
Input/simple_HTTPS_GET_request-16                                                                          3.193m ±  15%    3.283m ±  11%        ~ (p=0.165 n=10)
Input/request_honors_rate_limit-16                                                                         628.2µ ±  55%    635.2µ ±  17%        ~ (p=0.447 n=9+10)
Input/request_retries_when_failed-16                                                                       872.9µ ± 213%    824.3µ ±  31%        ~ (p=0.604 n=10+9)
Input/POST_request_with_body-16                                                                           1287.3µ ± 117%    881.5µ ±  90%        ~ (p=0.143 n=10)
Input/repeated_POST_requests-16                                                                            103.2m ±  43%    103.4m ±  74%        ~ (p=0.393 n=10)
Input/split_by_json_objects_array-16                                                                       882.4µ ±  67%    932.9µ ±  37%        ~ (p=0.912 n=10)
Input/split_by_json_objects_array_with_keep_parent-16                                                      848.4µ ±  11%    925.5µ ± 172%        ~ (p=0.315 n=9+10)
Input/split_on_empty_array_without_ignore_empty_value-16                                                   1.129m ±  71%    1.358m ± 159%        ~ (p=0.631 n=10)
Input/split_on_empty_array_with_ignore_empty_value-16                                                       5.001 ±   0%     5.001 ±   0%        ~ (p=0.739 n=10)
Input/split_on_null_field_with_ignore_empty_value_keeping_parent-16                                        555.4µ ±  23%    519.0µ ±  31%        ~ (p=0.579 n=10)
Input/split_on_empty_array_with_ignore_empty_value_keeping_parent-16                                       918.9µ ±  12%    894.8µ ±  11%        ~ (p=0.968 n=9+10)
Input/split_on_null_field_at_root_with_ignore_empty_value_keeping_parent-16                                805.2µ ±  18%    798.5µ ±  29%        ~ (p=0.968 n=10+9)
Input/split_on_empty_array_at_root_with_ignore_empty_value_keeping_parent-16                               922.8µ ±  25%    715.8µ ±  19%  -22.43% (p=0.001 n=9+10)
Input/nested_split-16                                                                                      1.243m ±  59%    1.020m ±  37%        ~ (p=0.762 n=10+8)
Input/split_events_by_not_found-16                                                                          5.000 ±   0%     5.000 ±   0%        ~ (p=0.631 n=10)
Input/pagination-16                                                                                        6.838m ±  14%    6.763m ±   5%        ~ (p=0.912 n=10)
Input/first_event-16                                                                                        2.004 ±   0%     2.005 ±   5%        ~ (p=0.315 n=10)
Input/oauth2-16                                                                                            1.089m ±  33%    1.032m ±  29%        ~ (p=0.912 n=10)
Input/request_transforms_can_access_state_from_previous_transforms-16                                      1.177m ±   7%    1.119m ±  12%        ~ (p=0.247 n=10)
Input/response_transforms_can't_access_request_state_from_previous_transforms-16                           882.8µ ±  13%    943.2µ ±   9%        ~ (p=0.113 n=9)
Input/simple_Chain_GET_request-16                                                                          1.603m ±  24%    1.449m ±  25%        ~ (p=0.739 n=10)
Input/multiple_Chain_GET_request-16                                                                        6.836m ± 249%    4.063m ± 120%        ~ (p=0.243 n=10+9)
Input/date_cursor_while_using_chain-16                                                                     2.050m ±  37%    1.665m ± 107%        ~ (p=0.143 n=10)
Input/split_by_json_objects_array_in_chain-16                                                              2.991m ±  64%    2.718m ±  47%        ~ (p=0.631 n=10)
Input/split_by_json_objects_array_with_keep_parent_in_chain-16                                             2.439m ±  44%    2.219m ±  50%        ~ (p=0.796 n=10)
Input/pagination_when_used_with_chaining-16                                                                5.331m ±  26%    4.548m ±  80%        ~ (p=0.684 n=10)
Input/replace_with_clause_and_first_response_object-16                                                     4.942m ± 207%    7.792m ±  61%        ~ (p=1.000 n=10)
Input/replace_with_clause_with_hardcoded_value_1-16                                                        3.493m ±  57%    4.563m ±  50%        ~ (p=0.436 n=10)
Input/replace_with_clause_with_hardcoded_value_(no_dot_prefix)-16                                          4.746m ±  56%    4.400m ± 145%        ~ (p=0.739 n=10)
Input/replace_with_clause_with_hardcoded_value_(more_than_one_dot_prefix)-16                               3.479m ±  98%    4.548m ± 197%        ~ (p=0.436 n=10)
Input/replace_with_clause_with_hardcoded_value_containing_'.'_(dots)-16                                    4.249m ±  77%    4.641m ± 106%        ~ (p=0.971 n=10)
Input/global_transform_context_separation_with_parent_last_response_object-16                              8.644m ±  57%    7.546m ± 126%        ~ (p=0.631 n=10)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination-16                              10.65m ±  32%    13.54m ±  48%        ~ (p=0.247 n=10)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination_along_with_split_operator-16    9.896m ±  58%   10.520m ±  52%        ~ (p=1.000 n=10)
Input/Test_simple_XML_decode-16                                                                            14.48m ±  69%    14.91m ±  33%        ~ (p=0.796 n=10)
geomean                                                                                                    4.478m           4.392m          -1.92%

                                                                                                        │  old.bench   │               new.bench                │
                                                                                                        │     B/op     │     B/op       vs base                 │
Input/simple_GET_request-16                                                                               99.97Ki ± 0%    99.34Ki ± 0%  -0.63% (p=0.001 n=10)
Input/simple_HTTPS_GET_request-16                                                                         182.6Ki ± 0%    181.8Ki ± 0%  -0.46% (p=0.001 n=10)
Input/request_honors_rate_limit-16                                                                        98.91Ki ± 0%    97.84Ki ± 0%  -1.08% (p=0.000 n=9+10)
Input/request_retries_when_failed-16                                                                      99.70Ki ± 0%    98.89Ki ± 1%  -0.81% (p=0.013 n=10+9)
Input/POST_request_with_body-16                                                                           101.1Ki ± 0%    100.4Ki ± 0%  -0.69% (p=0.001 n=10)
Input/repeated_POST_requests-16                                                                           136.9Ki ± 2%    134.7Ki ± 1%       ~ (p=0.063 n=10)
Input/split_by_json_objects_array-16                                                                      103.3Ki ± 0%    102.2Ki ± 1%  -1.08% (p=0.000 n=10)
Input/split_by_json_objects_array_with_keep_parent-16                                                     103.9Ki ± 0%    103.0Ki ± 0%  -0.94% (p=0.000 n=9+10)
Input/split_on_empty_array_without_ignore_empty_value-16                                                  99.79Ki ± 0%   100.04Ki ± 0%  +0.25% (p=0.002 n=10)
Input/split_on_empty_array_with_ignore_empty_value-16                                                     235.8Ki ± 4%    224.9Ki ± 5%  -4.62% (p=0.007 n=10)
Input/split_on_null_field_with_ignore_empty_value_keeping_parent-16                                       99.46Ki ± 0%    98.87Ki ± 0%  -0.59% (p=0.001 n=10)
Input/split_on_empty_array_with_ignore_empty_value_keeping_parent-16                                      99.69Ki ± 0%    99.30Ki ± 0%  -0.39% (p=0.001 n=9+10)
Input/split_on_null_field_at_root_with_ignore_empty_value_keeping_parent-16                               99.09Ki ± 0%    98.76Ki ± 0%  -0.34% (p=0.002 n=10+9)
Input/split_on_empty_array_at_root_with_ignore_empty_value_keeping_parent-16                              99.24Ki ± 0%    98.55Ki ± 0%  -0.70% (p=0.001 n=9+10)
Input/nested_split-16                                                                                     104.0Ki ± 0%    103.1Ki ± 0%  -0.87% (p=0.004 n=10+8)
Input/split_events_by_not_found-16                                                                        235.8Ki ± 5%    232.1Ki ± 6%       ~ (p=0.631 n=10)
Input/pagination-16                                                                                       420.1Ki ± 0%    417.6Ki ± 0%  -0.60% (p=0.001 n=10)
Input/first_event-16                                                                                      320.9Ki ± 4%    315.8Ki ± 6%       ~ (p=0.631 n=10)
Input/oauth2-16                                                                                           124.9Ki ± 0%    124.3Ki ± 0%  -0.53% (p=0.001 n=10)
Input/request_transforms_can_access_state_from_previous_transforms-16                                     161.5Ki ± 0%    160.8Ki ± 0%  -0.44% (p=0.002 n=10)
Input/response_transforms_can't_access_request_state_from_previous_transforms-16                          142.3Ki ± 0%    141.3Ki ± 0%  -0.69% (p=0.000 n=9)
Input/simple_Chain_GET_request-16                                                                         160.1Ki ± 0%    159.0Ki ± 0%  -0.73% (p=0.001 n=10)
Input/multiple_Chain_GET_request-16                                                                       216.8Ki ± 1%    215.2Ki ± 1%  -0.75% (p=0.002 n=10+9)
Input/date_cursor_while_using_chain-16                                                                    210.8Ki ± 0%    209.8Ki ± 0%  -0.45% (p=0.001 n=10)
Input/split_by_json_objects_array_in_chain-16                                                             163.7Ki ± 0%    162.1Ki ± 0%  -1.00% (p=0.000 n=10)
Input/split_by_json_objects_array_with_keep_parent_in_chain-16                                            164.2Ki ± 0%    162.6Ki ± 0%  -0.99% (p=0.001 n=10)
Input/pagination_when_used_with_chaining-16                                                               251.5Ki ± 0%    247.5Ki ± 0%  -1.58% (p=0.000 n=10)
Input/replace_with_clause_and_first_response_object-16                                                    245.8Ki ± 1%    244.1Ki ± 0%  -0.69% (p=0.001 n=10)
Input/replace_with_clause_with_hardcoded_value_1-16                                                       187.3Ki ± 1%    185.8Ki ± 0%  -0.80% (p=0.001 n=10)
Input/replace_with_clause_with_hardcoded_value_(no_dot_prefix)-16                                         190.4Ki ± 0%    188.6Ki ± 1%  -0.95% (p=0.000 n=10)
Input/replace_with_clause_with_hardcoded_value_(more_than_one_dot_prefix)-16                              191.6Ki ± 0%    190.0Ki ± 1%  -0.84% (p=0.000 n=10)
Input/replace_with_clause_with_hardcoded_value_containing_'.'_(dots)-16                                   187.8Ki ± 1%    186.1Ki ± 0%  -0.86% (p=0.001 n=10)
Input/global_transform_context_separation_with_parent_last_response_object-16                             363.9Ki ± 1%    359.2Ki ± 0%  -1.29% (p=0.000 n=10)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination-16                             447.2Ki ± 0%    447.7Ki ± 1%       ~ (p=0.684 n=10)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination_along_with_split_operator-16   459.7Ki ± 0%    456.9Ki ± 1%  -0.60% (p=0.017 n=10)
Input/Test_simple_XML_decode-16                                                                           2.644Mi ± 0%    2.644Mi ± 0%       ~ (p=0.739 n=10)
geomean                                                                                                   180.9Ki         179.3Ki       -0.88%

                                                                                                        │  old.bench  │              new.bench               │
                                                                                                        │  allocs/op  │  allocs/op   vs base                 │
Input/simple_GET_request-16                                                                                634.0 ± 0%    627.0 ± 0%  -1.10% (p=0.000 n=10)
Input/simple_HTTPS_GET_request-16                                                                         1.697k ± 0%   1.690k ± 0%  -0.41% (p=0.000 n=10)
Input/request_honors_rate_limit-16                                                                         605.0 ± 0%    597.0 ± 0%  -1.32% (p=0.000 n=9+10)
Input/request_retries_when_failed-16                                                                       605.0 ± 0%    598.0 ± 0%  -1.16% (p=0.001 n=10+9)
Input/POST_request_with_body-16                                                                            643.0 ± 0%    636.0 ± 0%  -1.09% (p=0.000 n=10)
Input/repeated_POST_requests-16                                                                            924.0 ± 1%    908.0 ± 1%  -1.73% (p=0.000 n=10)
Input/split_by_json_objects_array-16                                                                       658.0 ± 0%    646.0 ± 0%  -1.82% (p=0.000 n=10)
Input/split_by_json_objects_array_with_keep_parent-16                                                      668.0 ± 0%    656.0 ± 0%  -1.80% (p=0.000 n=9+10)
Input/split_on_empty_array_without_ignore_empty_value-16                                                   615.0 ± 0%    610.0 ± 0%  -0.81% (p=0.000 n=10)
Input/split_on_empty_array_with_ignore_empty_value-16                                                     1.526k ± 6%   1.521k ± 5%       ~ (p=0.288 n=10)
Input/split_on_null_field_with_ignore_empty_value_keeping_parent-16                                        613.0 ± 0%    606.0 ± 0%  -1.14% (p=0.000 n=10)
Input/split_on_empty_array_with_ignore_empty_value_keeping_parent-16                                       615.0 ± 0%    608.0 ± 0%  -1.14% (p=0.000 n=9+10)
Input/split_on_null_field_at_root_with_ignore_empty_value_keeping_parent-16                                610.0 ± 0%    603.0 ± 0%  -1.15% (n=10+9)
Input/split_on_empty_array_at_root_with_ignore_empty_value_keeping_parent-16                               612.0 ± 0%    605.0 ± 0%  -1.14% (p=0.000 n=9+10)
Input/nested_split-16                                                                                      665.0 ± 0%    652.0 ± 0%  -1.95% (n=10+8)
Input/split_events_by_not_found-16                                                                        1.592k ± 6%   1.587k ± 5%       ~ (p=0.592 n=10)
Input/pagination-16                                                                                       3.502k ± 0%   3.443k ± 0%  -1.67% (p=0.000 n=10)
Input/first_event-16                                                                                      2.329k ± 0%   2.281k ± 1%  -2.04% (p=0.000 n=10)
Input/oauth2-16                                                                                            867.0 ± 0%    860.0 ± 0%  -0.81% (p=0.000 n=10)
Input/request_transforms_can_access_state_from_previous_transforms-16                                     1.077k ± 0%   1.071k ± 0%  -0.60% (p=0.000 n=10)
Input/response_transforms_can't_access_request_state_from_previous_transforms-16                           924.0 ± 0%    917.0 ± 0%  -0.76% (p=0.000 n=9)
Input/simple_Chain_GET_request-16                                                                         1.025k ± 0%   1.010k ± 0%  -1.46% (p=0.000 n=10)
Input/multiple_Chain_GET_request-16                                                                       1.349k ± 0%   1.333k ± 0%  -1.22% (n=10+9)
Input/date_cursor_while_using_chain-16                                                                    1.403k ± 0%   1.389k ± 0%  -1.00% (p=0.000 n=10)
Input/split_by_json_objects_array_in_chain-16                                                             1.051k ± 0%   1.031k ± 0%  -1.90% (p=0.000 n=10)
Input/split_by_json_objects_array_with_keep_parent_in_chain-16                                            1.061k ± 0%   1.041k ± 0%  -1.89% (p=0.000 n=10)
Input/pagination_when_used_with_chaining-16                                                               1.815k ± 0%   1.779k ± 0%  -1.98% (p=0.000 n=10)
Input/replace_with_clause_and_first_response_object-16                                                    1.594k ± 0%   1.573k ± 0%  -1.32% (p=0.000 n=10)
Input/replace_with_clause_with_hardcoded_value_1-16                                                       1.249k ± 0%   1.229k ± 0%  -1.60% (p=0.000 n=10)
Input/replace_with_clause_with_hardcoded_value_(no_dot_prefix)-16                                         1.278k ± 0%   1.257k ± 0%  -1.64% (p=0.000 n=10)
Input/replace_with_clause_with_hardcoded_value_(more_than_one_dot_prefix)-16                              1.280k ± 0%   1.259k ± 0%  -1.64% (p=0.000 n=10)
Input/replace_with_clause_with_hardcoded_value_containing_'.'_(dots)-16                                   1.250k ± 0%   1.230k ± 0%  -1.64% (p=0.000 n=10)
Input/global_transform_context_separation_with_parent_last_response_object-16                             2.773k ± 0%   2.726k ± 0%  -1.69% (p=0.000 n=10)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination-16                             3.502k ± 0%   3.461k ± 0%  -1.19% (p=0.000 n=10)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination_along_with_split_operator-16   3.582k ± 0%   3.538k ± 0%  -1.23% (p=0.000 n=10)
Input/Test_simple_XML_decode-16                                                                           50.54k ± 0%   50.53k ± 0%  -0.01% (p=0.000 n=10)
geomean                                                                                                   1.247k        1.231k       -1.27%

On linux (a more reliable platform for benchmarking in my experience) there is a similar reduction in memory cost, but with the superior reliability of benchmarking on linux the noise floor is lowered and it's possible to see an ~3.5% reduction in CPU cost after the change.

goos: linux
goarch: amd64
pkg: github.com/elastic/beats/v7/x-pack/filebeat/input/httpjson
cpu: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
                                                                                                       │  old.bench   │               new.bench                │
                                                                                                       │    sec/op    │    sec/op     vs base                  │
Input/simple_GET_request-8                                                                               354.0µ ±  1%   335.5µ ±  1%  -5.21% (p=0.000 n=20)
Input/simple_HTTPS_GET_request-8                                                                         3.085m ±  5%   3.015m ±  5%       ~ (p=0.904 n=20)
Input/request_honors_rate_limit-8                                                                        332.4µ ±  0%   325.9µ ±  1%  -1.95% (p=0.001 n=20)
Input/request_retries_when_failed-8                                                                      345.2µ ±  1%   337.4µ ±  1%  -2.25% (p=0.002 n=20)
Input/POST_request_with_body-8                                                                           356.4µ ±  1%   338.4µ ±  1%  -5.06% (p=0.000 n=20)
Input/repeated_POST_requests-8                                                                           103.5m ±  0%   103.4m ±  0%  -0.16% (p=0.024 n=20)
Input/split_by_json_objects_array-8                                                                      361.4µ ±  1%   340.8µ ±  2%  -5.70% (p=0.000 n=19)
Input/split_by_json_objects_array_with_keep_parent-8                                                     361.7µ ±  1%   339.4µ ±  1%  -6.17% (p=0.000 n=20)
Input/split_on_empty_array_without_ignore_empty_value-8                                                  339.1µ ±  1%   330.1µ ±  1%  -2.63% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value-8                                                      5.000 ±  0%    5.001 ±  0%       ~ (p=0.301 n=20)
Input/split_on_null_field_with_ignore_empty_value_keeping_parent-8                                       337.0µ ±  1%   325.0µ ±  1%  -3.58% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value_keeping_parent-8                                      337.2µ ±  0%   323.8µ ±  1%  -3.97% (p=0.000 n=20)
Input/split_on_null_field_at_root_with_ignore_empty_value_keeping_parent-8                               335.6µ ±  1%   323.0µ ±  0%  -3.74% (p=0.000 n=20)
Input/split_on_empty_array_at_root_with_ignore_empty_value_keeping_parent-8                              337.4µ ±  1%   325.8µ ±  4%  -3.44% (p=0.001 n=14+17)
Input/nested_split-8                                                                                     359.1µ ±  1%   334.6µ ±  0%  -6.84% (p=0.000 n=20)
Input/pagination-8                                                                                       10.40m ±  2%   10.36m ±  1%       ~ (p=0.698 n=20)
Input/first_event-8                                                                                       2.006 ±  0%    2.005 ±  0%  -0.06% (p=0.017 n=20)
Input/oauth2-8                                                                                           579.0µ ±  1%   557.7µ ±  1%  -3.68% (p=0.000 n=20)
Input/request_transforms_can_access_state_from_previous_transforms-8                                     621.9µ ±  2%   590.3µ ±  1%  -5.09% (p=0.000 n=20)
Input/response_transforms_can't_access_request_state_from_previous_transforms-8                          540.5µ ±  1%   512.1µ ±  0%  -5.25% (p=0.000 n=20)
Input/simple_Chain_GET_request-8                                                                         627.1µ ±  1%   585.1µ ±  1%  -6.69% (p=0.000 n=20)
Input/multiple_Chain_GET_request-8                                                                       907.1µ ±  2%   862.1µ ±  5%  -4.96% (p=0.005 n=17)
Input/date_cursor_while_using_chain-8                                                                    871.3µ ±  1%   823.0µ ±  0%  -5.54% (p=0.000 n=20)
Input/split_by_json_objects_array_in_chain-8                                                             638.4µ ±  3%   592.8µ ±  2%  -7.13% (p=0.000 n=20)
Input/split_by_json_objects_array_with_keep_parent_in_chain-8                                            640.4µ ±  0%   593.6µ ±  1%  -7.32% (p=0.000 n=20+18)
Input/pagination_when_used_with_chaining-8                                                               1.318m ±  3%   1.234m ±  3%  -6.39% (p=0.001 n=20)
Input/replace_with_clause_and_first_response_object-8                                                    1.101m ±  1%   1.066m ±  4%       ~ (p=0.054 n=20+19)
Input/replace_with_clause_with_hardcoded_value_1-8                                                       838.4µ ±  2%   805.3µ ±  0%  -3.95% (p=0.000 n=19+20)
Input/replace_with_clause_with_hardcoded_value_(no_dot_prefix)-8                                         842.3µ ±  1%   827.9µ ±  3%  -1.71% (p=0.040 n=20)
Input/replace_with_clause_with_hardcoded_value_(more_than_one_dot_prefix)-8                              849.4µ ±  2%   859.1µ ±  3%       ~ (p=0.923 n=20+19)
Input/replace_with_clause_with_hardcoded_value_containing_'.'_(dots)-8                                   844.6µ ±  4%   831.2µ ± 10%       ~ (p=0.055 n=18+20)
Input/global_transform_context_separation_with_parent_last_response_object-8                             1.940m ±  2%   1.860m ±  1%  -4.12% (p=0.000 n=20)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination-8                             2.174m ±  2%   2.119m ±  1%  -2.52% (p=0.005 n=20+19)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination_along_with_split_operator-8   2.208m ±  1%   2.140m ±  0%  -3.08% (p=0.000 n=19+20)
Input/Test_simple_XML_decode-8                                                                           9.797m ± 11%   9.636m ±  1%  -1.64% (p=0.012 n=18+20)
Input/split_events_by_not_found-8                                                                                        5.001 ±  0%
geomean                                                                                                  1.428m         1.728m        -3.63%

                                                                                                       │  old.bench   │               new.bench                │
                                                                                                       │     B/op     │     B/op      vs base                  │
Input/simple_GET_request-8                                                                               99.76Ki ± 0%   99.16Ki ± 0%  -0.61% (p=0.000 n=20)
Input/simple_HTTPS_GET_request-8                                                                         184.1Ki ± 0%   183.3Ki ± 0%  -0.45% (p=0.000 n=20)
Input/request_honors_rate_limit-8                                                                        98.14Ki ± 0%   97.58Ki ± 0%  -0.58% (p=0.000 n=20)
Input/request_retries_when_failed-8                                                                      98.97Ki ± 0%   98.37Ki ± 0%  -0.61% (p=0.000 n=20)
Input/POST_request_with_body-8                                                                           100.7Ki ± 0%   100.1Ki ± 0%  -0.60% (p=0.000 n=20)
Input/repeated_POST_requests-8                                                                           136.1Ki ± 1%   135.2Ki ± 1%  -0.70% (p=0.002 n=20)
Input/split_by_json_objects_array-8                                                                      102.9Ki ± 0%   101.8Ki ± 0%  -0.99% (p=0.000 n=19)
Input/split_by_json_objects_array_with_keep_parent-8                                                     103.6Ki ± 0%   102.6Ki ± 0%  -1.01% (p=0.000 n=20)
Input/split_on_empty_array_without_ignore_empty_value-8                                                  99.27Ki ± 0%   98.68Ki ± 0%  -0.60% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value-8                                                     221.2Ki ± 4%   227.4Ki ± 2%       ~ (p=0.355 n=20)
Input/split_on_null_field_with_ignore_empty_value_keeping_parent-8                                       99.29Ki ± 0%   98.71Ki ± 0%  -0.59% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value_keeping_parent-8                                      99.36Ki ± 0%   98.76Ki ± 0%  -0.61% (p=0.000 n=20)
Input/split_on_null_field_at_root_with_ignore_empty_value_keeping_parent-8                               98.76Ki ± 0%   98.17Ki ± 0%  -0.60% (p=0.000 n=20)
Input/split_on_empty_array_at_root_with_ignore_empty_value_keeping_parent-8                              98.82Ki ± 0%   98.22Ki ± 0%  -0.61% (p=0.000 n=14+17)
Input/nested_split-8                                                                                     103.6Ki ± 0%   102.5Ki ± 0%  -0.99% (p=0.000 n=20)
Input/pagination-8                                                                                       429.2Ki ± 0%   425.7Ki ± 0%  -0.80% (p=0.000 n=20)
Input/first_event-8                                                                                      315.2Ki ± 1%   322.6Ki ± 4%       ~ (p=0.512 n=20)
Input/oauth2-8                                                                                           124.4Ki ± 0%   123.8Ki ± 0%  -0.53% (p=0.000 n=20)
Input/request_transforms_can_access_state_from_previous_transforms-8                                     160.2Ki ± 0%   159.6Ki ± 0%  -0.39% (p=0.000 n=20)
Input/response_transforms_can't_access_request_state_from_previous_transforms-8                          140.3Ki ± 0%   139.7Ki ± 0%  -0.46% (p=0.000 n=20)
Input/simple_Chain_GET_request-8                                                                         159.5Ki ± 0%   158.2Ki ± 0%  -0.82% (p=0.000 n=20)
Input/multiple_Chain_GET_request-8                                                                       214.8Ki ± 0%   215.2Ki ± 0%  +0.18% (p=0.013 n=17)
Input/date_cursor_while_using_chain-8                                                                    209.7Ki ± 0%   208.3Ki ± 0%  -0.66% (p=0.000 n=20)
Input/split_by_json_objects_array_in_chain-8                                                             162.7Ki ± 0%   161.0Ki ± 0%  -1.07% (p=0.000 n=20)
Input/split_by_json_objects_array_with_keep_parent_in_chain-8                                            163.5Ki ± 0%   161.8Ki ± 0%  -1.08% (p=0.000 n=20+18)
Input/pagination_when_used_with_chaining-8                                                               247.8Ki ± 0%   245.4Ki ± 0%  -0.95% (p=0.000 n=20)
Input/replace_with_clause_and_first_response_object-8                                                    244.1Ki ± 0%   242.1Ki ± 0%  -0.79% (p=0.000 n=20+19)
Input/replace_with_clause_with_hardcoded_value_1-8                                                       186.3Ki ± 0%   184.6Ki ± 0%  -0.92% (p=0.000 n=19+20)
Input/replace_with_clause_with_hardcoded_value_(no_dot_prefix)-8                                         188.8Ki ± 0%   187.2Ki ± 0%  -0.87% (p=0.000 n=20)
Input/replace_with_clause_with_hardcoded_value_(more_than_one_dot_prefix)-8                              189.0Ki ± 0%   187.3Ki ± 0%  -0.93% (p=0.000 n=20+19)
Input/replace_with_clause_with_hardcoded_value_containing_'.'_(dots)-8                                   186.6Ki ± 0%   184.9Ki ± 0%  -0.91% (p=0.000 n=18+20)
Input/global_transform_context_separation_with_parent_last_response_object-8                             357.2Ki ± 0%   354.4Ki ± 0%  -0.79% (p=0.000 n=20)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination-8                             442.3Ki ± 0%   439.1Ki ± 0%  -0.72% (p=0.000 n=20+19)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination_along_with_split_operator-8   452.7Ki ± 0%   449.2Ki ± 0%  -0.78% (p=0.000 n=19+20)
Input/Test_simple_XML_decode-8                                                                           2.645Mi ± 0%   2.644Mi ± 0%  -0.03% (p=0.000 n=18+20)
Input/split_events_by_not_found-8                                                                                       230.9Ki ± 2%
geomean                                                                                                  178.2Ki        178.6Ki       -0.51%

                                                                                                       │  old.bench  │               new.bench               │
                                                                                                       │  allocs/op  │  allocs/op   vs base                  │
Input/simple_GET_request-8                                                                                631.0 ± 0%    624.0 ± 0%  -1.11% (p=0.000 n=20)
Input/simple_HTTPS_GET_request-8                                                                         1.715k ± 0%   1.708k ± 0%  -0.41% (p=0.000 n=20)
Input/request_honors_rate_limit-8                                                                         601.0 ± 0%    594.0 ± 0%  -1.16% (p=0.000 n=20)
Input/request_retries_when_failed-8                                                                       602.0 ± 0%    595.0 ± 0%  -1.16% (p=0.000 n=20)
Input/POST_request_with_body-8                                                                            640.0 ± 0%    633.0 ± 0%  -1.09% (p=0.000 n=20)
Input/repeated_POST_requests-8                                                                            919.5 ± 0%    905.0 ± 0%  -1.58% (p=0.000 n=20)
Input/split_by_json_objects_array-8                                                                       656.0 ± 0%    643.0 ± 0%  -1.98% (p=0.000 n=19)
Input/split_by_json_objects_array_with_keep_parent-8                                                      666.0 ± 0%    653.0 ± 0%  -1.95% (p=0.000 n=20)
Input/split_on_empty_array_without_ignore_empty_value-8                                                   612.0 ± 0%    605.0 ± 0%  -1.14% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value-8                                                     1.516k ± 1%   1.508k ± 0%       ~ (p=0.062 n=20)
Input/split_on_null_field_with_ignore_empty_value_keeping_parent-8                                        610.0 ± 0%    603.0 ± 0%  -1.15% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value_keeping_parent-8                                       612.0 ± 0%    605.0 ± 0%  -1.14% (p=0.000 n=20)
Input/split_on_null_field_at_root_with_ignore_empty_value_keeping_parent-8                                607.0 ± 0%    600.0 ± 0%  -1.15% (p=0.000 n=20)
Input/split_on_empty_array_at_root_with_ignore_empty_value_keeping_parent-8                               609.0 ± 0%    602.0 ± 0%  -1.15% (n=14+17)
Input/nested_split-8                                                                                      662.0 ± 0%    649.0 ± 0%  -1.96% (p=0.000 n=20)
Input/pagination-8                                                                                       3.574k ± 0%   3.507k ± 0%  -1.85% (p=0.000 n=20)
Input/first_event-8                                                                                      2.325k ± 0%   2.300k ± 0%  -1.08% (p=0.000 n=20)
Input/oauth2-8                                                                                            862.0 ± 0%    855.0 ± 0%  -0.81% (p=0.000 n=20)
Input/request_transforms_can_access_state_from_previous_transforms-8                                     1.072k ± 0%   1.065k ± 0%  -0.65% (p=0.000 n=20)
Input/response_transforms_can't_access_request_state_from_previous_transforms-8                           918.0 ± 0%    911.0 ± 0%  -0.76% (p=0.000 n=20)
Input/simple_Chain_GET_request-8                                                                         1.022k ± 0%   1.006k ± 0%  -1.52% (p=0.000 n=20)
Input/multiple_Chain_GET_request-8                                                                       1.344k ± 0%   1.332k ± 0%  -0.89% (p=0.000 n=17)
Input/date_cursor_while_using_chain-8                                                                    1.399k ± 0%   1.384k ± 0%  -1.07% (p=0.000 n=20)
Input/split_by_json_objects_array_in_chain-8                                                             1.048k ± 0%   1.027k ± 0%  -2.00% (p=0.000 n=20)
Input/split_by_json_objects_array_with_keep_parent_in_chain-8                                            1.059k ± 0%   1.037k ± 0%  -2.08% (p=0.000 n=20+18)
Input/pagination_when_used_with_chaining-8                                                               1.804k ± 0%   1.774k ± 0%  -1.66% (p=0.000 n=20)
Input/replace_with_clause_and_first_response_object-8                                                    1.590k ± 0%   1.567k ± 0%  -1.45% (n=20+19)
Input/replace_with_clause_with_hardcoded_value_1-8                                                       1.246k ± 0%   1.225k ± 0%  -1.69% (p=0.000 n=19+20)
Input/replace_with_clause_with_hardcoded_value_(no_dot_prefix)-8                                         1.274k ± 0%   1.253k ± 0%  -1.65% (p=0.000 n=20)
Input/replace_with_clause_with_hardcoded_value_(more_than_one_dot_prefix)-8                              1.274k ± 0%   1.253k ± 0%  -1.65% (n=20+19)
Input/replace_with_clause_with_hardcoded_value_containing_'.'_(dots)-8                                   1.247k ± 0%   1.226k ± 0%  -1.68% (n=18+20)
Input/global_transform_context_separation_with_parent_last_response_object-8                             2.762k ± 0%   2.719k ± 0%  -1.56% (p=0.000 n=20)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination-8                             3.493k ± 0%   3.449k ± 0%  -1.26% (p=0.000 n=20+19)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination_along_with_split_operator-8   3.570k ± 0%   3.527k ± 0%  -1.20% (p=0.000 n=19+20)
Input/Test_simple_XML_decode-8                                                                           50.30k ± 0%   50.30k ± 0%  -0.01% (p=0.000 n=18+20)
Input/split_events_by_not_found-8                                                                                      1.572k ± 1%
geomean                                                                                                  1.235k        1.227k       -1.29%

@efd6 efd6 added enhancement Team:Security-External Integrations backport-skip Skip notification from the automated backport with mergify 8.11-candidate labels Sep 4, 2023
@efd6 efd6 self-assigned this Sep 4, 2023
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Sep 4, 2023
@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 4, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-09-04T08:05:21.065+0000

  • Duration: 77 min 9 sec

Test stats 🧪

Test Results
Failed 0
Passed 3132
Skipped 176
Total 3308

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@efd6 efd6 marked this pull request as ready for review September 4, 2023 10:01
@efd6 efd6 requested a review from a team as a code owner September 4, 2023 10:01
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@efd6
Copy link
Contributor Author

efd6 commented Sep 4, 2023

This change fixes the flakey test in #34929. Applying the same (similar; actually sensibly readable this time) grain of sand as in the analysis and unskipping the test now passes, as expected since there can be no race now.

diff --git a/x-pack/filebeat/input/httpjson/input_test.go b/x-pack/filebeat/input/httpjson/input_test.go
index e88a0a28d3..91ba8a1125 100644
--- a/x-pack/filebeat/input/httpjson/input_test.go
+++ b/x-pack/filebeat/input/httpjson/input_test.go
@@ -374,7 +374,7 @@ var testCases = []struct {
                },
        },
        {
-               skipReason: "flakey test - see https://github.com/elastic/beats/issues/34929",
+               // skipReason: "flakey test - see https://github.com/elastic/beats/issues/34929",

                name: "first_event",
                setupServer: func(t testing.TB, h http.HandlerFunc, config map[string]interface{}) {
diff --git a/x-pack/filebeat/input/httpjson/request.go b/x-pack/filebeat/input/httpjson/request.go
index 6a1d926ab4..3ed904f16d 100644
--- a/x-pack/filebeat/input/httpjson/request.go
+++ b/x-pack/filebeat/input/httpjson/request.go
@@ -16,6 +16,7 @@ import (
        "reflect"
        "strconv"
        "strings"
+       "time"

        "github.com/PaesslerAG/jsonpath"

@@ -741,6 +742,10 @@ func newPublisher(trCtx *transformContext, pub inputcursor.Publisher, publish bo
 }

 func (p *publisher) event(_ context.Context, msg mapstr.M) {
+       if p.n == 0 {
+               time.Sleep(10 * time.Millisecond)
+       }
+
        if p.pub != nil {
                event, err := makeEvent(msg)
                if err != nil {

$ go test -v -run TestInput/first_event
=== RUN   TestInput
=== RUN   TestInput/first_event
--- PASS: TestInput (2.03s)
    --- PASS: TestInput/first_event (2.03s)
PASS
ok  	github.com/elastic/beats/v7/x-pack/filebeat/input/httpjson	2.841s

For completeness, the same change as here applied to main.

diff --git a/x-pack/filebeat/input/httpjson/input_test.go b/x-pack/filebeat/input/httpjson/input_test.go
index e88a0a28d3..91ba8a1125 100644
--- a/x-pack/filebeat/input/httpjson/input_test.go
+++ b/x-pack/filebeat/input/httpjson/input_test.go
@@ -374,7 +374,7 @@ var testCases = []struct {
                },
        },
        {
-               skipReason: "flakey test - see https://github.com/elastic/beats/issues/34929",
+               // skipReason: "flakey test - see https://github.com/elastic/beats/issues/34929",

                name: "first_event",
                setupServer: func(t testing.TB, h http.HandlerFunc, config map[string]interface{}) {
diff --git a/x-pack/filebeat/input/httpjson/request.go b/x-pack/filebeat/input/httpjson/request.go
index f92d2944c7..2f93d5d391 100644
--- a/x-pack/filebeat/input/httpjson/request.go
+++ b/x-pack/filebeat/input/httpjson/request.go
@@ -16,6 +16,7 @@ import (
        "reflect"
        "strconv"
        "strings"
+       "time"

        "github.com/PaesslerAG/jsonpath"

@@ -706,6 +707,10 @@ func processAndPublishEvents(trCtx *transformContext, events <-chan maybeMsg, pu
                        continue
                }

+               if n == 0 {
+                       time.Sleep(10 * time.Millisecond)
+               }
+
                if publish {
                        event, err := makeEvent(maybeMsg.msg)
                        if err != nil {
$ go test -v -run TestInput/first_event
=== RUN   TestInput
=== RUN   TestInput/first_event
    input_test.go:1313:
        	Error Trace:	.../github.com/elastic/beats/x-pack/filebeat/input/httpjson/input_test.go:1313
        	Error:      	Not equal:
        	            	expected: map[string]interface {}{"first":"a", "foo":"b"}
        	            	actual  : map[string]interface {}{"first":"none", "foo":"b"}

        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,3 +1,3 @@
        	            	 (map[string]interface {}) (len=2) {
        	            	- (string) (len=5) "first": (string) (len=1) "a",
        	            	+ (string) (len=5) "first": (string) (len=4) "none",
        	            	  (string) (len=3) "foo": (string) (len=1) "b"
        	Test:       	TestInput/first_event
--- FAIL: TestInput (2.03s)
    --- FAIL: TestInput/first_event (2.03s)
FAIL
exit status 1
FAIL	github.com/elastic/beats/v7/x-pack/filebeat/input/httpjson	2.694s

Reactivating this test will be in its own PR.

Copy link
Contributor

@marc-gr marc-gr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Awesome to see the progress here!

Copy link
Contributor

@ShourieG ShourieG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Awesome work so far. The refactor is looking great.

One question from my end. Right now during chain pagination events, we skip the first event (same as the legacy approach) because we have already processed it. Can we handle this more elegantly in future, for example using the response of the initial chain request (if pagination exists) to directly start from request/page 2 instead to performing the initial request again ?

@efd6
Copy link
Contributor Author

efd6 commented Sep 6, 2023

@ShourieG That would be an issue to file, but it's out of scope for the work here.

@efd6 efd6 merged commit 2b0076b into elastic:main Sep 6, 2023
19 of 21 checks passed
Scholar-Li pushed a commit to Scholar-Li/beats that referenced this pull request Feb 5, 2024
…essing (elastic#36493)

Replace concurrent code and locks with sequential processing using handler
interface types to simplify data flow. Rather that sending events/errors on a
channel to process in a separate gorouting, have a handler that has a couple
of methods to handle either events or error non-concurrently with the event
construction.

The process to refactor was to progressively convert the channel to implement
the proposed handler interface, split the chan range function into the two
handler methods and then remove the range instead calling the appropriate
method within the generator.

After this was done, the locks required to protect concurrent access of
transformers were removed.

goos: linux
goarch: amd64
pkg: github.com/elastic/beats/v7/x-pack/filebeat/input/httpjson
cpu: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
                                                                                                       │  old.bench   │               new.bench                │
                                                                                                       │    sec/op    │    sec/op     vs base                  │
Input/simple_GET_request-8                                                                               354.0µ ±  1%   335.5µ ±  1%  -5.21% (p=0.000 n=20)
Input/simple_HTTPS_GET_request-8                                                                         3.085m ±  5%   3.015m ±  5%       ~ (p=0.904 n=20)
Input/request_honors_rate_limit-8                                                                        332.4µ ±  0%   325.9µ ±  1%  -1.95% (p=0.001 n=20)
Input/request_retries_when_failed-8                                                                      345.2µ ±  1%   337.4µ ±  1%  -2.25% (p=0.002 n=20)
Input/POST_request_with_body-8                                                                           356.4µ ±  1%   338.4µ ±  1%  -5.06% (p=0.000 n=20)
Input/repeated_POST_requests-8                                                                           103.5m ±  0%   103.4m ±  0%  -0.16% (p=0.024 n=20)
Input/split_by_json_objects_array-8                                                                      361.4µ ±  1%   340.8µ ±  2%  -5.70% (p=0.000 n=19)
Input/split_by_json_objects_array_with_keep_parent-8                                                     361.7µ ±  1%   339.4µ ±  1%  -6.17% (p=0.000 n=20)
Input/split_on_empty_array_without_ignore_empty_value-8                                                  339.1µ ±  1%   330.1µ ±  1%  -2.63% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value-8                                                      5.000 ±  0%    5.001 ±  0%       ~ (p=0.301 n=20)
Input/split_on_null_field_with_ignore_empty_value_keeping_parent-8                                       337.0µ ±  1%   325.0µ ±  1%  -3.58% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value_keeping_parent-8                                      337.2µ ±  0%   323.8µ ±  1%  -3.97% (p=0.000 n=20)
Input/split_on_null_field_at_root_with_ignore_empty_value_keeping_parent-8                               335.6µ ±  1%   323.0µ ±  0%  -3.74% (p=0.000 n=20)
Input/split_on_empty_array_at_root_with_ignore_empty_value_keeping_parent-8                              337.4µ ±  1%   325.8µ ±  4%  -3.44% (p=0.001 n=14+17)
Input/nested_split-8                                                                                     359.1µ ±  1%   334.6µ ±  0%  -6.84% (p=0.000 n=20)
Input/pagination-8                                                                                       10.40m ±  2%   10.36m ±  1%       ~ (p=0.698 n=20)
Input/first_event-8                                                                                       2.006 ±  0%    2.005 ±  0%  -0.06% (p=0.017 n=20)
Input/oauth2-8                                                                                           579.0µ ±  1%   557.7µ ±  1%  -3.68% (p=0.000 n=20)
Input/request_transforms_can_access_state_from_previous_transforms-8                                     621.9µ ±  2%   590.3µ ±  1%  -5.09% (p=0.000 n=20)
Input/response_transforms_can't_access_request_state_from_previous_transforms-8                          540.5µ ±  1%   512.1µ ±  0%  -5.25% (p=0.000 n=20)
Input/simple_Chain_GET_request-8                                                                         627.1µ ±  1%   585.1µ ±  1%  -6.69% (p=0.000 n=20)
Input/multiple_Chain_GET_request-8                                                                       907.1µ ±  2%   862.1µ ±  5%  -4.96% (p=0.005 n=17)
Input/date_cursor_while_using_chain-8                                                                    871.3µ ±  1%   823.0µ ±  0%  -5.54% (p=0.000 n=20)
Input/split_by_json_objects_array_in_chain-8                                                             638.4µ ±  3%   592.8µ ±  2%  -7.13% (p=0.000 n=20)
Input/split_by_json_objects_array_with_keep_parent_in_chain-8                                            640.4µ ±  0%   593.6µ ±  1%  -7.32% (p=0.000 n=20+18)
Input/pagination_when_used_with_chaining-8                                                               1.318m ±  3%   1.234m ±  3%  -6.39% (p=0.001 n=20)
Input/replace_with_clause_and_first_response_object-8                                                    1.101m ±  1%   1.066m ±  4%       ~ (p=0.054 n=20+19)
Input/replace_with_clause_with_hardcoded_value_1-8                                                       838.4µ ±  2%   805.3µ ±  0%  -3.95% (p=0.000 n=19+20)
Input/replace_with_clause_with_hardcoded_value_(no_dot_prefix)-8                                         842.3µ ±  1%   827.9µ ±  3%  -1.71% (p=0.040 n=20)
Input/replace_with_clause_with_hardcoded_value_(more_than_one_dot_prefix)-8                              849.4µ ±  2%   859.1µ ±  3%       ~ (p=0.923 n=20+19)
Input/replace_with_clause_with_hardcoded_value_containing_'.'_(dots)-8                                   844.6µ ±  4%   831.2µ ± 10%       ~ (p=0.055 n=18+20)
Input/global_transform_context_separation_with_parent_last_response_object-8                             1.940m ±  2%   1.860m ±  1%  -4.12% (p=0.000 n=20)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination-8                             2.174m ±  2%   2.119m ±  1%  -2.52% (p=0.005 n=20+19)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination_along_with_split_operator-8   2.208m ±  1%   2.140m ±  0%  -3.08% (p=0.000 n=19+20)
Input/Test_simple_XML_decode-8                                                                           9.797m ± 11%   9.636m ±  1%  -1.64% (p=0.012 n=18+20)
Input/split_events_by_not_found-8                                                                                        5.001 ±  0%
geomean                                                                                                  1.428m         1.728m        -3.63%

                                                                                                       │  old.bench   │               new.bench                │
                                                                                                       │     B/op     │     B/op      vs base                  │
Input/simple_GET_request-8                                                                               99.76Ki ± 0%   99.16Ki ± 0%  -0.61% (p=0.000 n=20)
Input/simple_HTTPS_GET_request-8                                                                         184.1Ki ± 0%   183.3Ki ± 0%  -0.45% (p=0.000 n=20)
Input/request_honors_rate_limit-8                                                                        98.14Ki ± 0%   97.58Ki ± 0%  -0.58% (p=0.000 n=20)
Input/request_retries_when_failed-8                                                                      98.97Ki ± 0%   98.37Ki ± 0%  -0.61% (p=0.000 n=20)
Input/POST_request_with_body-8                                                                           100.7Ki ± 0%   100.1Ki ± 0%  -0.60% (p=0.000 n=20)
Input/repeated_POST_requests-8                                                                           136.1Ki ± 1%   135.2Ki ± 1%  -0.70% (p=0.002 n=20)
Input/split_by_json_objects_array-8                                                                      102.9Ki ± 0%   101.8Ki ± 0%  -0.99% (p=0.000 n=19)
Input/split_by_json_objects_array_with_keep_parent-8                                                     103.6Ki ± 0%   102.6Ki ± 0%  -1.01% (p=0.000 n=20)
Input/split_on_empty_array_without_ignore_empty_value-8                                                  99.27Ki ± 0%   98.68Ki ± 0%  -0.60% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value-8                                                     221.2Ki ± 4%   227.4Ki ± 2%       ~ (p=0.355 n=20)
Input/split_on_null_field_with_ignore_empty_value_keeping_parent-8                                       99.29Ki ± 0%   98.71Ki ± 0%  -0.59% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value_keeping_parent-8                                      99.36Ki ± 0%   98.76Ki ± 0%  -0.61% (p=0.000 n=20)
Input/split_on_null_field_at_root_with_ignore_empty_value_keeping_parent-8                               98.76Ki ± 0%   98.17Ki ± 0%  -0.60% (p=0.000 n=20)
Input/split_on_empty_array_at_root_with_ignore_empty_value_keeping_parent-8                              98.82Ki ± 0%   98.22Ki ± 0%  -0.61% (p=0.000 n=14+17)
Input/nested_split-8                                                                                     103.6Ki ± 0%   102.5Ki ± 0%  -0.99% (p=0.000 n=20)
Input/pagination-8                                                                                       429.2Ki ± 0%   425.7Ki ± 0%  -0.80% (p=0.000 n=20)
Input/first_event-8                                                                                      315.2Ki ± 1%   322.6Ki ± 4%       ~ (p=0.512 n=20)
Input/oauth2-8                                                                                           124.4Ki ± 0%   123.8Ki ± 0%  -0.53% (p=0.000 n=20)
Input/request_transforms_can_access_state_from_previous_transforms-8                                     160.2Ki ± 0%   159.6Ki ± 0%  -0.39% (p=0.000 n=20)
Input/response_transforms_can't_access_request_state_from_previous_transforms-8                          140.3Ki ± 0%   139.7Ki ± 0%  -0.46% (p=0.000 n=20)
Input/simple_Chain_GET_request-8                                                                         159.5Ki ± 0%   158.2Ki ± 0%  -0.82% (p=0.000 n=20)
Input/multiple_Chain_GET_request-8                                                                       214.8Ki ± 0%   215.2Ki ± 0%  +0.18% (p=0.013 n=17)
Input/date_cursor_while_using_chain-8                                                                    209.7Ki ± 0%   208.3Ki ± 0%  -0.66% (p=0.000 n=20)
Input/split_by_json_objects_array_in_chain-8                                                             162.7Ki ± 0%   161.0Ki ± 0%  -1.07% (p=0.000 n=20)
Input/split_by_json_objects_array_with_keep_parent_in_chain-8                                            163.5Ki ± 0%   161.8Ki ± 0%  -1.08% (p=0.000 n=20+18)
Input/pagination_when_used_with_chaining-8                                                               247.8Ki ± 0%   245.4Ki ± 0%  -0.95% (p=0.000 n=20)
Input/replace_with_clause_and_first_response_object-8                                                    244.1Ki ± 0%   242.1Ki ± 0%  -0.79% (p=0.000 n=20+19)
Input/replace_with_clause_with_hardcoded_value_1-8                                                       186.3Ki ± 0%   184.6Ki ± 0%  -0.92% (p=0.000 n=19+20)
Input/replace_with_clause_with_hardcoded_value_(no_dot_prefix)-8                                         188.8Ki ± 0%   187.2Ki ± 0%  -0.87% (p=0.000 n=20)
Input/replace_with_clause_with_hardcoded_value_(more_than_one_dot_prefix)-8                              189.0Ki ± 0%   187.3Ki ± 0%  -0.93% (p=0.000 n=20+19)
Input/replace_with_clause_with_hardcoded_value_containing_'.'_(dots)-8                                   186.6Ki ± 0%   184.9Ki ± 0%  -0.91% (p=0.000 n=18+20)
Input/global_transform_context_separation_with_parent_last_response_object-8                             357.2Ki ± 0%   354.4Ki ± 0%  -0.79% (p=0.000 n=20)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination-8                             442.3Ki ± 0%   439.1Ki ± 0%  -0.72% (p=0.000 n=20+19)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination_along_with_split_operator-8   452.7Ki ± 0%   449.2Ki ± 0%  -0.78% (p=0.000 n=19+20)
Input/Test_simple_XML_decode-8                                                                           2.645Mi ± 0%   2.644Mi ± 0%  -0.03% (p=0.000 n=18+20)
Input/split_events_by_not_found-8                                                                                       230.9Ki ± 2%
geomean                                                                                                  178.2Ki        178.6Ki       -0.51%

                                                                                                       │  old.bench  │               new.bench               │
                                                                                                       │  allocs/op  │  allocs/op   vs base                  │
Input/simple_GET_request-8                                                                                631.0 ± 0%    624.0 ± 0%  -1.11% (p=0.000 n=20)
Input/simple_HTTPS_GET_request-8                                                                         1.715k ± 0%   1.708k ± 0%  -0.41% (p=0.000 n=20)
Input/request_honors_rate_limit-8                                                                         601.0 ± 0%    594.0 ± 0%  -1.16% (p=0.000 n=20)
Input/request_retries_when_failed-8                                                                       602.0 ± 0%    595.0 ± 0%  -1.16% (p=0.000 n=20)
Input/POST_request_with_body-8                                                                            640.0 ± 0%    633.0 ± 0%  -1.09% (p=0.000 n=20)
Input/repeated_POST_requests-8                                                                            919.5 ± 0%    905.0 ± 0%  -1.58% (p=0.000 n=20)
Input/split_by_json_objects_array-8                                                                       656.0 ± 0%    643.0 ± 0%  -1.98% (p=0.000 n=19)
Input/split_by_json_objects_array_with_keep_parent-8                                                      666.0 ± 0%    653.0 ± 0%  -1.95% (p=0.000 n=20)
Input/split_on_empty_array_without_ignore_empty_value-8                                                   612.0 ± 0%    605.0 ± 0%  -1.14% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value-8                                                     1.516k ± 1%   1.508k ± 0%       ~ (p=0.062 n=20)
Input/split_on_null_field_with_ignore_empty_value_keeping_parent-8                                        610.0 ± 0%    603.0 ± 0%  -1.15% (p=0.000 n=20)
Input/split_on_empty_array_with_ignore_empty_value_keeping_parent-8                                       612.0 ± 0%    605.0 ± 0%  -1.14% (p=0.000 n=20)
Input/split_on_null_field_at_root_with_ignore_empty_value_keeping_parent-8                                607.0 ± 0%    600.0 ± 0%  -1.15% (p=0.000 n=20)
Input/split_on_empty_array_at_root_with_ignore_empty_value_keeping_parent-8                               609.0 ± 0%    602.0 ± 0%  -1.15% (n=14+17)
Input/nested_split-8                                                                                      662.0 ± 0%    649.0 ± 0%  -1.96% (p=0.000 n=20)
Input/pagination-8                                                                                       3.574k ± 0%   3.507k ± 0%  -1.85% (p=0.000 n=20)
Input/first_event-8                                                                                      2.325k ± 0%   2.300k ± 0%  -1.08% (p=0.000 n=20)
Input/oauth2-8                                                                                            862.0 ± 0%    855.0 ± 0%  -0.81% (p=0.000 n=20)
Input/request_transforms_can_access_state_from_previous_transforms-8                                     1.072k ± 0%   1.065k ± 0%  -0.65% (p=0.000 n=20)
Input/response_transforms_can't_access_request_state_from_previous_transforms-8                           918.0 ± 0%    911.0 ± 0%  -0.76% (p=0.000 n=20)
Input/simple_Chain_GET_request-8                                                                         1.022k ± 0%   1.006k ± 0%  -1.52% (p=0.000 n=20)
Input/multiple_Chain_GET_request-8                                                                       1.344k ± 0%   1.332k ± 0%  -0.89% (p=0.000 n=17)
Input/date_cursor_while_using_chain-8                                                                    1.399k ± 0%   1.384k ± 0%  -1.07% (p=0.000 n=20)
Input/split_by_json_objects_array_in_chain-8                                                             1.048k ± 0%   1.027k ± 0%  -2.00% (p=0.000 n=20)
Input/split_by_json_objects_array_with_keep_parent_in_chain-8                                            1.059k ± 0%   1.037k ± 0%  -2.08% (p=0.000 n=20+18)
Input/pagination_when_used_with_chaining-8                                                               1.804k ± 0%   1.774k ± 0%  -1.66% (p=0.000 n=20)
Input/replace_with_clause_and_first_response_object-8                                                    1.590k ± 0%   1.567k ± 0%  -1.45% (n=20+19)
Input/replace_with_clause_with_hardcoded_value_1-8                                                       1.246k ± 0%   1.225k ± 0%  -1.69% (p=0.000 n=19+20)
Input/replace_with_clause_with_hardcoded_value_(no_dot_prefix)-8                                         1.274k ± 0%   1.253k ± 0%  -1.65% (p=0.000 n=20)
Input/replace_with_clause_with_hardcoded_value_(more_than_one_dot_prefix)-8                              1.274k ± 0%   1.253k ± 0%  -1.65% (n=20+19)
Input/replace_with_clause_with_hardcoded_value_containing_'.'_(dots)-8                                   1.247k ± 0%   1.226k ± 0%  -1.68% (n=18+20)
Input/global_transform_context_separation_with_parent_last_response_object-8                             2.762k ± 0%   2.719k ± 0%  -1.56% (p=0.000 n=20)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination-8                             3.493k ± 0%   3.449k ± 0%  -1.26% (p=0.000 n=20+19)
Input/cursor_value_is_updated_for_root_response_with_chaining_&_pagination_along_with_split_operator-8   3.570k ± 0%   3.527k ± 0%  -1.20% (p=0.000 n=19+20)
Input/Test_simple_XML_decode-8                                                                           50.30k ± 0%   50.30k ± 0%  -0.01% (p=0.000 n=18+20)
Input/split_events_by_not_found-8                                                                                      1.572k ± 1%
geomean                                                                                                  1.235k        1.227k       -1.29%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.11-candidate backport-skip Skip notification from the automated backport with mergify enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants