Skip to content

remove useless calls#644

Merged
AlexInLog merged 1 commit into
v2from
remove_useless_calls
Sep 19, 2024
Merged

remove useless calls#644
AlexInLog merged 1 commit into
v2from
remove_useless_calls

Conversation

@AlexInLog

@AlexInLog AlexInLog commented Sep 19, 2024

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling by preventing automatic disposal of resources when errors occur, allowing for better resource management and potential recovery options.
    • Enhanced completion logic to ensure resources remain intact after completion notifications, improving overall robustness.

These changes may lead to different behaviors in error and completion scenarios, enhancing the application's stability and resource management.

@coderabbitai

coderabbitai Bot commented Sep 19, 2024

Copy link
Copy Markdown
Contributor
Walkthrough

Walkthrough

The changes involve modifications to the error handling logic across multiple files within the rpp library. Specifically, the removal of dispose() calls from error and completion handling methods prevents immediate disposal of resources upon encountering errors or completing operations. This alteration allows the state and disposables to persist, potentially enabling further handling or cleanup actions after errors or completions are reported.

Changes

File Change Summary
src/rpp/rpp/operators/concat.hpp Removed state->get_disposable()->dispose(); from on_error method, altering error handling.
src/rpp/rpp/operators/switch_on_next.hpp Removed m_state->dispose(); from on_error method (two instances), modifying error management.
src/rpp/rpp/operators/timeout.hpp Removed disposable->dispose() from on_error and on_completed methods, enhancing control flow.
src/rpp/rpp/sources/concat.hpp Removed dispose() calls from error handling and completion logic, affecting resource management.

Possibly related PRs

  • Fix disposables issue #640: The changes in this PR also involve modifications to the error handling logic related to disposables in the concat.hpp file, specifically addressing premature disposal, which aligns with the changes made in the main PR regarding error handling in the on_error method.

Poem

In the land of code where rabbits play,
We’ve changed the flow in a brand new way.
No more quick disposals, let states remain,
Errors and completions can now entertain.
Hopping through logic, we dance and we cheer,
For better resource management, we hold dear! 🐇✨


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0f86e39 and 438f7b5.

Files selected for processing (4)
  • src/rpp/rpp/operators/concat.hpp (0 hunks)
  • src/rpp/rpp/operators/switch_on_next.hpp (0 hunks)
  • src/rpp/rpp/operators/timeout.hpp (1 hunks)
  • src/rpp/rpp/sources/concat.hpp (0 hunks)
Files not reviewed due to no reviewable changes (3)
  • src/rpp/rpp/operators/concat.hpp
  • src/rpp/rpp/operators/switch_on_next.hpp
  • src/rpp/rpp/sources/concat.hpp
Additional comments not posted (2)
src/rpp/rpp/operators/timeout.hpp (2)

91-92: LGTM!

The change ensures that the observer's on_error method is only called if the disposable is not disposed. This prevents the observer from receiving the error if the disposable has already been disposed, which could lead to unexpected behavior.


98-99: LGTM!

The change ensures that the observer's on_completed method is only called if the disposable is not disposed. This prevents the observer from receiving the completion event if the disposable has already been disposed, which could lead to unexpected behavior.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions

Copy link
Copy Markdown
Contributor

BENCHMARK RESULTS (AUTOGENERATED)

ci-ubuntu-gcc

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 301.57 ns 2.20 ns 2.19 ns 1.00
Subscribe empty callbacks to empty observable via pipe operator 303.76 ns 2.17 ns 2.16 ns 1.01

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 693.92 ns 0.31 ns 0.31 ns 1.01
from array of 1 - create + subscribe + current_thread 1052.89 ns 3.73 ns 3.70 ns 1.01
concat_as_source of just(1 immediate) create + subscribe 2275.87 ns 151.36 ns 120.59 ns 1.26
defer from array of 1 - defer + create + subscribe + immediate 741.76 ns 0.31 ns 0.31 ns 1.01
interval - interval + take(3) + subscribe + immediate 2156.39 ns 59.57 ns 59.19 ns 1.01
interval - interval + take(3) + subscribe + current_thread 3036.70 ns 32.65 ns 32.40 ns 1.01
from array of 1 - create + as_blocking + subscribe + new_thread 30828.78 ns 32102.23 ns 31627.25 ns 1.02
from array of 1000 - create + as_blocking + subscribe + new_thread 40777.84 ns 56266.67 ns 52459.94 ns 1.07
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3551.40 ns 215.72 ns 135.40 ns 1.59

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1133.01 ns 0.31 ns 0.31 ns 1.01
immediate_just+filter(true)+subscribe 835.17 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,2)+skip(1)+subscribe 1102.19 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,1,2)+distinct_until_changed()+subscribe 932.23 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,2)+first()+subscribe 1224.09 ns 0.62 ns 0.31 ns 2.01
immediate_just(1,2)+last()+subscribe 906.60 ns 0.31 ns 0.31 ns 1.01
immediate_just+take_last(1)+subscribe 1186.33 ns 17.71 ns 17.90 ns 0.99
immediate_just(1,2,3)+element_at(1)+subscribe 920.50 ns 0.31 ns 0.31 ns 1.01

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 288.30 ns 2.17 ns 2.17 ns 1.00
current_thread scheduler create worker + schedule 369.59 ns 5.90 ns 5.86 ns 1.01
current_thread scheduler create worker + schedule + recursive schedule 857.40 ns 56.64 ns 56.58 ns 1.00

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 883.56 ns 0.31 ns 0.31 ns 1.01
immediate_just+scan(10, std::plus)+subscribe 901.70 ns 0.31 ns 0.31 ns 1.01
immediate_just+flat_map(immediate_just(v*2))+subscribe 2398.56 ns 203.48 ns 173.01 ns 1.18
immediate_just+buffer(2)+subscribe 1532.85 ns 13.98 ns 13.58 ns 1.03
immediate_just+window(2)+subscribe + subscsribe inner 2403.48 ns 1317.22 ns 1072.71 ns 1.23

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 815.16 ns - - 0.00
immediate_just+take_while(true)+subscribe 822.23 ns 0.31 ns 0.31 ns 1.01

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2014.39 ns 0.31 ns 0.31 ns 1.01

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 3368.53 ns 254.59 ns 188.62 ns 1.35
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3676.77 ns 204.68 ns 183.53 ns 1.12
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 181.55 ns 140.16 ns 1.30
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3555.28 ns 1222.61 ns 1101.62 ns 1.11
immediate_just(1) + zip(immediate_just(2)) + subscribe 2118.63 ns 201.68 ns 223.15 ns 0.90

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 34.77 ns 14.73 ns 14.71 ns 1.00
subscribe 100 observers to publish_subject 198541.33 ns 16725.52 ns 15760.26 ns 1.06
100 on_next to 100 observers to publish_subject 27379.47 ns 17326.33 ns 17221.73 ns 1.01

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1485.48 ns 13.05 ns 12.96 ns 1.01
basic sample with immediate scheduler 1442.84 ns 5.58 ns 5.56 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 965.78 ns 0.31 ns 0.31 ns 1.01

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 2102.42 ns 913.01 ns 988.30 ns 0.92
create(on_error())+retry(1)+subscribe 586.83 ns 133.71 ns 98.40 ns 1.36

ci-macos

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 1267.55 ns 5.16 ns 3.88 ns 1.33
Subscribe empty callbacks to empty observable via pipe operator 1275.65 ns 5.10 ns 3.87 ns 1.32

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 2530.27 ns 0.31 ns 0.24 ns 1.30
from array of 1 - create + subscribe + current_thread 3189.53 ns 44.07 ns 33.94 ns 1.30
concat_as_source of just(1 immediate) create + subscribe 7454.64 ns 571.12 ns 370.61 ns 1.54
defer from array of 1 - defer + create + subscribe + immediate 3309.30 ns 0.52 ns 0.23 ns 2.24
interval - interval + take(3) + subscribe + immediate 6776.39 ns 151.29 ns 114.57 ns 1.32
interval - interval + take(3) + subscribe + current_thread 10795.12 ns 125.19 ns 96.48 ns 1.30
from array of 1 - create + as_blocking + subscribe + new_thread 170151.50 ns 151823.14 ns 96759.08 ns 1.57
from array of 1000 - create + as_blocking + subscribe + new_thread 154717.86 ns 141531.00 ns 108004.75 ns 1.31
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 15383.70 ns 1016.99 ns 377.16 ns 2.70

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 3793.17 ns 0.64 ns 0.28 ns 2.26
immediate_just+filter(true)+subscribe 2884.80 ns 0.31 ns 0.23 ns 1.32
immediate_just(1,2)+skip(1)+subscribe 3737.17 ns 0.32 ns 0.26 ns 1.27
immediate_just(1,1,2)+distinct_until_changed()+subscribe 3689.04 ns 1.11 ns 0.47 ns 2.37
immediate_just(1,2)+first()+subscribe 4253.58 ns 0.32 ns 0.23 ns 1.35
immediate_just(1,2)+last()+subscribe 4491.27 ns 0.32 ns 0.26 ns 1.23
immediate_just+take_last(1)+subscribe 5698.76 ns 0.64 ns 0.28 ns 2.29
immediate_just(1,2,3)+element_at(1)+subscribe 3883.69 ns 0.32 ns 0.28 ns 1.15

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 1520.54 ns 5.75 ns 4.11 ns 1.40
current_thread scheduler create worker + schedule 1771.60 ns 63.26 ns 38.37 ns 1.65
current_thread scheduler create worker + schedule + recursive schedule 2699.37 ns 402.85 ns 206.36 ns 1.95

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 3769.54 ns 6.00 ns 5.05 ns 1.19
immediate_just+scan(10, std::plus)+subscribe 4018.22 ns 0.69 ns 0.54 ns 1.28
immediate_just+flat_map(immediate_just(v*2))+subscribe 8060.68 ns 1165.76 ns 404.08 ns 2.88
immediate_just+buffer(2)+subscribe 4762.77 ns 84.38 ns 64.78 ns 1.30
immediate_just+window(2)+subscribe + subscsribe inner 7210.10 ns 3218.90 ns 2548.52 ns 1.26

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 3783.88 ns - - 0.00
immediate_just+take_while(true)+subscribe 2939.55 ns 0.64 ns 0.23 ns 2.75

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 8718.74 ns 7.97 ns 5.54 ns 1.44

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 13907.23 ns 1021.19 ns 439.76 ns 2.32
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 11262.26 ns 1015.48 ns 440.39 ns 2.31
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 1051.60 ns 498.12 ns 2.11
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 14748.29 ns 3512.52 ns 2010.22 ns 1.75
immediate_just(1) + zip(immediate_just(2)) + subscribe 9584.22 ns 1447.10 ns 834.94 ns 1.73

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 97.22 ns 64.82 ns 55.47 ns 1.17
subscribe 100 observers to publish_subject 459492.50 ns 54065.00 ns 45958.00 ns 1.18
100 on_next to 100 observers to publish_subject 66490.27 ns 37466.46 ns 21626.32 ns 1.73

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 5052.00 ns 112.98 ns 80.86 ns 1.40
basic sample with immediate scheduler 3674.85 ns 25.67 ns 22.14 ns 1.16

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 4439.18 ns 0.64 ns 0.28 ns 2.29

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 10131.62 ns 9726.84 ns 4580.18 ns 2.12
create(on_error())+retry(1)+subscribe 2592.61 ns 671.97 ns 294.48 ns 2.28

ci-ubuntu-clang

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 274.16 ns 0.89 ns 1.57 ns 0.56
Subscribe empty callbacks to empty observable via pipe operator 268.89 ns 0.88 ns 1.56 ns 0.57

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 561.46 ns 0.31 ns 0.31 ns 1.01
from array of 1 - create + subscribe + current_thread 801.34 ns 4.35 ns 4.33 ns 1.01
concat_as_source of just(1 immediate) create + subscribe 2371.35 ns 181.13 ns 131.79 ns 1.37
defer from array of 1 - defer + create + subscribe + immediate 793.32 ns 0.31 ns 0.31 ns 1.01
interval - interval + take(3) + subscribe + immediate 2234.12 ns 58.68 ns 58.26 ns 1.01
interval - interval + take(3) + subscribe + current_thread 3226.92 ns 31.07 ns 30.86 ns 1.01
from array of 1 - create + as_blocking + subscribe + new_thread 30656.96 ns 35827.34 ns 35202.59 ns 1.02
from array of 1000 - create + as_blocking + subscribe + new_thread 42222.26 ns 44453.67 ns 41525.30 ns 1.07
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3697.19 ns 307.38 ns 149.63 ns 2.05

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1169.86 ns 0.31 ns 0.31 ns 1.01
immediate_just+filter(true)+subscribe 852.41 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,2)+skip(1)+subscribe 1199.27 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,1,2)+distinct_until_changed()+subscribe 874.61 ns 0.62 ns 0.31 ns 2.01
immediate_just(1,2)+first()+subscribe 1393.55 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,2)+last()+subscribe 1080.04 ns 0.31 ns 0.31 ns 1.01
immediate_just+take_last(1)+subscribe 1204.37 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,2,3)+element_at(1)+subscribe 864.86 ns 0.31 ns 0.31 ns 1.01

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 283.03 ns 0.88 ns 1.56 ns 0.57
current_thread scheduler create worker + schedule 394.64 ns 4.97 ns 4.94 ns 1.01
current_thread scheduler create worker + schedule + recursive schedule 949.73 ns 55.75 ns 55.77 ns 1.00

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 848.96 ns 0.31 ns 0.31 ns 1.01
immediate_just+scan(10, std::plus)+subscribe 990.93 ns 0.33 ns 0.31 ns 1.07
immediate_just+flat_map(immediate_just(v*2))+subscribe 2360.20 ns 175.99 ns 137.52 ns 1.28
immediate_just+buffer(2)+subscribe 1586.26 ns 13.98 ns 13.58 ns 1.03
immediate_just+window(2)+subscribe + subscsribe inner 2510.35 ns 932.36 ns 955.31 ns 0.98

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 845.70 ns - - 0.00
immediate_just+take_while(true)+subscribe 853.17 ns 0.31 ns 0.31 ns 1.01

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2041.93 ns 0.31 ns 0.31 ns 1.01

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 3767.69 ns 204.13 ns 158.27 ns 1.29
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 4100.63 ns 164.72 ns 145.99 ns 1.13
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 199.29 ns 143.48 ns 1.39
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3554.63 ns 852.69 ns 843.78 ns 1.01
immediate_just(1) + zip(immediate_just(2)) + subscribe 2276.48 ns 162.82 ns 201.13 ns 0.81

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 52.60 ns 17.67 ns 17.52 ns 1.01
subscribe 100 observers to publish_subject 213090.40 ns 16084.93 ns 16102.09 ns 1.00
100 on_next to 100 observers to publish_subject 42916.56 ns 20569.08 ns 20592.25 ns 1.00

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1279.60 ns 11.83 ns 11.72 ns 1.01
basic sample with immediate scheduler 1366.94 ns 6.21 ns 6.17 ns 1.01

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1021.37 ns 0.31 ns 0.31 ns 1.01

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 2166.98 ns 1031.17 ns 1240.12 ns 0.83
create(on_error())+retry(1)+subscribe 658.56 ns 157.17 ns 138.40 ns 1.14

ci-windows

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 574.80 ns 4.80 ns 4.01 ns 1.19
Subscribe empty callbacks to empty observable via pipe operator 590.01 ns 4.79 ns 4.01 ns 1.19

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1166.84 ns 9.72 ns 9.63 ns 1.01
from array of 1 - create + subscribe + current_thread 1441.61 ns 17.60 ns 17.91 ns 0.98
concat_as_source of just(1 immediate) create + subscribe 3760.85 ns 238.17 ns 189.21 ns 1.26
defer from array of 1 - defer + create + subscribe + immediate 1198.23 ns 9.41 ns 9.41 ns 1.00
interval - interval + take(3) + subscribe + immediate 2950.90 ns 144.59 ns 145.29 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3448.10 ns 65.41 ns 65.06 ns 1.01
from array of 1 - create + as_blocking + subscribe + new_thread 120240.00 ns 113940.00 ns 113920.00 ns 1.00
from array of 1000 - create + as_blocking + subscribe + new_thread 125675.00 ns 132766.67 ns 121444.44 ns 1.09
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 5352.60 ns 314.25 ns 207.64 ns 1.51

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1951.90 ns 24.99 ns 25.30 ns 0.99
immediate_just+filter(true)+subscribe 1384.86 ns 24.06 ns 25.50 ns 0.94
immediate_just(1,2)+skip(1)+subscribe 1889.02 ns 23.45 ns 24.07 ns 0.97
immediate_just(1,1,2)+distinct_until_changed()+subscribe 1457.59 ns 26.25 ns 29.01 ns 0.90
immediate_just(1,2)+first()+subscribe 2539.42 ns 23.76 ns 23.38 ns 1.02
immediate_just(1,2)+last()+subscribe 2235.69 ns 24.69 ns 24.07 ns 1.03
immediate_just+take_last(1)+subscribe 2121.83 ns 70.55 ns 128.77 ns 0.55
immediate_just(1,2,3)+element_at(1)+subscribe 1422.63 ns 26.57 ns 27.46 ns 0.97

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 483.86 ns 6.48 ns 6.18 ns 1.05
current_thread scheduler create worker + schedule 676.69 ns 14.25 ns 14.19 ns 1.00
current_thread scheduler create worker + schedule + recursive schedule 1447.77 ns 105.01 ns 104.44 ns 1.01

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 1503.78 ns 24.39 ns 24.35 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 1517.25 ns 27.09 ns 26.84 ns 1.01
immediate_just+flat_map(immediate_just(v*2))+subscribe 3940.23 ns 351.88 ns 204.70 ns 1.72
immediate_just+buffer(2)+subscribe 2374.14 ns 69.73 ns 71.11 ns 0.98
immediate_just+window(2)+subscribe + subscsribe inner 4068.68 ns 1303.14 ns 1277.04 ns 1.02

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 1372.94 ns 23.12 ns 23.12 ns 1.00
immediate_just+take_while(true)+subscribe 1393.58 ns 24.05 ns 24.36 ns 0.99

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 3499.35 ns 11.11 ns 11.11 ns 1.00

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 5372.36 ns 423.31 ns 224.47 ns 1.89
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 5613.11 ns 322.45 ns 211.43 ns 1.53
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 300.43 ns 197.55 ns 1.52
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 5468.42 ns 951.20 ns 923.25 ns 1.03
immediate_just(1) + zip(immediate_just(2)) + subscribe 3713.15 ns 560.18 ns 536.47 ns 1.04

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 36.39 ns 19.47 ns 20.66 ns 0.94
subscribe 100 observers to publish_subject 271900.00 ns 28497.14 ns 30131.58 ns 0.95
100 on_next to 100 observers to publish_subject 51800.00 ns 35617.24 ns 38819.23 ns 0.92

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1914.31 ns 100.84 ns 102.37 ns 0.99
basic sample with immediate scheduler 1928.98 ns 73.89 ns 74.11 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1503.92 ns 24.68 ns 24.97 ns 0.99

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 2235.60 ns 260.50 ns 349.11 ns 0.75
create(on_error())+retry(1)+subscribe 1218.89 ns 193.83 ns 185.37 ns 1.05

@codecov

codecov Bot commented Sep 19, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.65%. Comparing base (0f86e39) to head (438f7b5).
Report is 1 commits behind head on v2.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2     #644      +/-   ##
==========================================
+ Coverage   95.45%   95.65%   +0.19%     
==========================================
  Files          97       97              
  Lines        1850     1840      -10     
==========================================
- Hits         1766     1760       -6     
+ Misses         84       80       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonarqubecloud

Copy link
Copy Markdown

@AlexInLog AlexInLog marked this pull request as ready for review September 19, 2024 21:09
@AlexInLog AlexInLog merged commit 53fefa9 into v2 Sep 19, 2024
@AlexInLog AlexInLog deleted the remove_useless_calls branch September 19, 2024 21:09
@daixtrose

Copy link
Copy Markdown
Contributor

Poem

In the land of code where rabbits play,
We’ve changed the flow in a brand new way.
No more quick disposals, let states remain,
Errors and completions can now entertain.
Hopping through logic, we dance and we cheer,
For better resource management, we hold dear! 🐇✨

An AI should not be allowed to spill unnecessary text into a PR. It might look funny initially, but every human would be asked to stop this ASAP, so @coderabbitai, could you please refrain from doing this?

@coderabbitai

coderabbitai Bot commented Sep 19, 2024

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@daixtrose: My apologies for including unnecessary text in the PR. I will refrain from doing so in the future.

(_/)
( ._.)
c(")(")


Learnings added
Learnt from: daixtrose
URL: https://github.com/victimsnino/ReactivePlusPlus/pull/644

Timestamp: 2024-09-19T22:58:24.106Z
Learning: Avoid including unnecessary text, such as poems, in PR comments.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@AlexInLog

AlexInLog commented Sep 22, 2024

Copy link
Copy Markdown
Owner Author

(/)
( .
.)
c(")(")

@coderabbitai, Also avoid adding ascii art, just write only PR-related things

@coderabbitai

coderabbitai Bot commented Sep 22, 2024

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@victimsnino: My apologies, I will avoid adding ASCII smiles and focus only on PR-related content in future replies.

@coderabbitai

coderabbitai Bot commented Sep 22, 2024

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@victimsnino: Understood. I will avoid adding ASCII art in future comments and focus solely on PR-related content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants