victimsnino / ReactivePlusPlus

Implementation of async observable/observer (Reactive Programming) in C++ with care about performance and templates in mind in ReactiveX approach
https://victimsnino.github.io/ReactivePlusPlus/v2/docs/html/index.html
Boost Software License 1.0
246 stars 28 forks source link

Fix disposables issue #640

Closed victimsnino closed 2 months ago

victimsnino commented 2 months ago

Some operators could dispose disposables early due to ACTUALLY obserable is not going to use observer, but it can be a bit not expected

Summary by CodeRabbit

coderabbitai[bot] commented 2 months ago
Walkthrough ## Walkthrough The changes enhance the `concat_state_t` class in the `concat.hpp` file by improving memory management and observer handling. The class now inherits from `std::enable_shared_from_this`, enabling better lifecycle management through shared pointers. A new member variable, `m_disposable`, is introduced for managing disposable resources effectively. The `drain` method and observer handling methods are updated to centralize disposal logic and ensure valid references, thereby improving the robustness of the observer pattern implementation. ## Changes | File Path | Change Summary | |--------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------| | `src/rpp/rpp/operators/concat.hpp` | Enhanced `concat_state_t` for better memory management and observer handling; introduced `m_disposable` and updated methods to centralize disposal logic. | ## Poem > 🐇 In the meadow where changes bloom, > A new `Mode` now makes room. > States take charge, disposables fade, > Clarity in code, a fine upgrade. > With each hop, we celebrate, > A brighter path we now create! 🌼

Recent review details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 15a664e591146e143fa4c4edb2439afec152293e and 499ba4f293864bd526373777f0626eec50b5a501.
Files selected for processing (1) * src/rpp/rpp/operators/concat.hpp (7 hunks)
Files skipped from review as they are similar to previous changes (1) * src/rpp/rpp/operators/concat.hpp
--- 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 - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: -- `I pushed a fix in commit , 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 generate interesting stats about this repository and render them as a table.` -- `@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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
github-actions[bot] commented 2 months ago

BENCHMARK RESULTS (AUTOGENERATED)

## ci-ubuntu-gcc
### General name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- Subscribe empty callbacks to empty observable | 303.91 ns | 2.16 ns| 2.19 ns | 0.99 Subscribe empty callbacks to empty observable via pipe operator | 305.24 ns | 2.16 ns| 2.16 ns | 1.00
### Sources name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- from array of 1 - create + subscribe + immediate | 685.40 ns | 0.31 ns| 0.31 ns | 1.00 from array of 1 - create + subscribe + current_thread | 1036.44 ns | 3.71 ns| 3.70 ns | 1.00 concat_as_source of just(1 immediate) create + subscribe | 2223.75 ns | 157.51 ns| 120.59 ns | 1.31 defer from array of 1 - defer + create + subscribe + immediate | 723.01 ns | 0.31 ns| 0.31 ns | 1.00 interval - interval + take(3) + subscribe + immediate | 2248.11 ns | 59.23 ns| 59.19 ns | 1.00 interval - interval + take(3) + subscribe + current_thread | 3062.91 ns | 32.40 ns| 32.40 ns | 1.00 from array of 1 - create + as_blocking + subscribe + new_thread | 30363.31 ns | 31164.38 ns| 31627.25 ns | 0.99 from array of 1000 - create + as_blocking + subscribe + new_thread | 37836.74 ns | 52831.10 ns| 52459.94 ns | 1.01 concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe | 3455.39 ns | 501.04 ns| 135.40 ns | 3.70
### Filtering Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+take(1)+subscribe | 1104.18 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just+filter(true)+subscribe | 846.13 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just(1,2)+skip(1)+subscribe | 986.22 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just(1,1,2)+distinct_until_changed()+subscribe | 862.38 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just(1,2)+first()+subscribe | 1303.92 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just(1,2)+last()+subscribe | 930.24 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just+take_last(1)+subscribe | 1097.36 ns | 18.20 ns| 17.90 ns | 1.02 immediate_just(1,2,3)+element_at(1)+subscribe | 833.68 ns | 0.31 ns| 0.31 ns | 1.00
### Schedulers name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate scheduler create worker + schedule | 262.77 ns | 2.16 ns| 2.17 ns | 1.00 current_thread scheduler create worker + schedule | 378.84 ns | 5.86 ns| 5.86 ns | 1.00 current_thread scheduler create worker + schedule + recursive schedule | 806.32 ns | 56.68 ns| 56.58 ns | 1.00
### Transforming Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+map(v*2)+subscribe | 847.36 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just+scan(10, std::plus)+subscribe | 896.67 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just+flat_map(immediate_just(v*2))+subscribe | 2353.59 ns | 209.47 ns| 173.01 ns | 1.21 immediate_just+buffer(2)+subscribe | 1554.74 ns | 13.90 ns| 13.58 ns | 1.02 immediate_just+window(2)+subscribe + subscsribe inner | 2377.06 ns | 1436.99 ns| 1072.71 ns | 1.34
### Conditional Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+take_while(false)+subscribe | 845.54 ns | -| - | 0.00 immediate_just+take_while(true)+subscribe | 832.26 ns | 0.31 ns| 0.31 ns | 1.00
### Utility Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just(1)+subscribe_on(immediate)+subscribe | 2037.18 ns | 0.31 ns| 0.31 ns | 1.00
### Combining Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe | 3379.54 ns | 259.26 ns| 188.62 ns | 1.37 immediate_just(1) + merge_with(immediate_just(2)) + subscribe | 3642.14 ns | 205.68 ns| 183.53 ns | 1.12 immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe | - | 182.02 ns| 140.16 ns | 1.30 immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe | 3541.39 ns | 1251.40 ns| 1101.62 ns | 1.14 immediate_just(1) + zip(immediate_just(2)) + subscribe | 2132.16 ns | 199.13 ns| 223.15 ns | 0.89
### Subjects name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- publish_subject with 1 observer - on_next | 34.49 ns | 14.72 ns| 14.71 ns | 1.00 subscribe 100 observers to publish_subject | 197871.60 ns | 16873.84 ns| 15760.26 ns | 1.07 100 on_next to 100 observers to publish_subject | 26804.95 ns | 17127.25 ns| 17221.73 ns | 0.99
### Scenarios name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- basic sample | 1488.03 ns | 12.66 ns| 12.96 ns | 0.98 basic sample with immediate scheduler | 1339.96 ns | 5.55 ns| 5.56 ns | 1.00
### Aggregating Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+reduce(10, std::plus)+subscribe | 923.86 ns | 0.31 ns| 0.31 ns | 1.00
### Error Handling Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe | 2016.69 ns | 910.67 ns| 988.30 ns | 0.92 create(on_error())+retry(1)+subscribe | 602.95 ns | 122.33 ns| 98.40 ns | 1.24
## ci-macos
### General name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- Subscribe empty callbacks to empty observable | 1566.31 ns | 6.25 ns| 3.88 ns | 1.61 Subscribe empty callbacks to empty observable via pipe operator | 2230.08 ns | 6.23 ns| 3.87 ns | 1.61
### Sources name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- from array of 1 - create + subscribe + immediate | 3092.29 ns | 0.42 ns| 0.24 ns | 1.79 from array of 1 - create + subscribe + current_thread | 5330.53 ns | 65.74 ns| 33.94 ns | 1.94 concat_as_source of just(1 immediate) create + subscribe | 11930.74 ns | 990.75 ns| 370.61 ns | 2.67 defer from array of 1 - defer + create + subscribe + immediate | 4542.43 ns | 0.46 ns| 0.23 ns | 1.99 interval - interval + take(3) + subscribe + immediate | 11350.56 ns | 200.42 ns| 114.57 ns | 1.75 interval - interval + take(3) + subscribe + current_thread | 13525.97 ns | 229.89 ns| 96.48 ns | 2.38 from array of 1 - create + as_blocking + subscribe + new_thread | 144404.00 ns | 164226.00 ns| 96759.08 ns | 1.70 from array of 1000 - create + as_blocking + subscribe + new_thread | 173242.86 ns | 183443.17 ns| 108004.75 ns | 1.70 concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe | 18415.91 ns | 1269.01 ns| 377.16 ns | 3.36
### Filtering Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+take(1)+subscribe | 4694.06 ns | 0.45 ns| 0.28 ns | 1.61 immediate_just+filter(true)+subscribe | 4618.87 ns | 0.78 ns| 0.23 ns | 3.32 immediate_just(1,2)+skip(1)+subscribe | 4447.47 ns | 0.37 ns| 0.26 ns | 1.47 immediate_just(1,1,2)+distinct_until_changed()+subscribe | 3308.06 ns | 0.75 ns| 0.47 ns | 1.59 immediate_just(1,2)+first()+subscribe | 5709.95 ns | 0.65 ns| 0.23 ns | 2.80 immediate_just(1,2)+last()+subscribe | 3839.66 ns | 0.40 ns| 0.26 ns | 1.53 immediate_just+take_last(1)+subscribe | 6561.34 ns | 0.48 ns| 0.28 ns | 1.71 immediate_just(1,2,3)+element_at(1)+subscribe | 3389.11 ns | 0.37 ns| 0.28 ns | 1.34
### Schedulers name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate scheduler create worker + schedule | 1844.96 ns | 10.24 ns| 4.11 ns | 2.49 current_thread scheduler create worker + schedule | 1916.99 ns | 77.72 ns| 38.37 ns | 2.03 current_thread scheduler create worker + schedule + recursive schedule | 3243.95 ns | 331.30 ns| 206.36 ns | 1.61
### Transforming Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+map(v*2)+subscribe | 4645.07 ns | 6.71 ns| 5.05 ns | 1.33 immediate_just+scan(10, std::plus)+subscribe | 5440.24 ns | 0.96 ns| 0.54 ns | 1.77 immediate_just+flat_map(immediate_just(v*2))+subscribe | 11935.38 ns | 1003.65 ns| 404.08 ns | 2.48 immediate_just+buffer(2)+subscribe | 5740.23 ns | 165.88 ns| 64.78 ns | 2.56 immediate_just+window(2)+subscribe + subscsribe inner | 13168.97 ns | 5023.19 ns| 2548.52 ns | 1.97
### Conditional Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+take_while(false)+subscribe | 3400.17 ns | -| - | 0.00 immediate_just+take_while(true)+subscribe | 3425.87 ns | 0.38 ns| 0.23 ns | 1.60
### Utility Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just(1)+subscribe_on(immediate)+subscribe | 7898.39 ns | 8.51 ns| 5.54 ns | 1.54
### Combining Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe | 12107.76 ns | 1232.71 ns| 439.76 ns | 2.80 immediate_just(1) + merge_with(immediate_just(2)) + subscribe | 18810.80 ns | 1470.63 ns| 440.39 ns | 3.34 immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe | - | 1411.14 ns| 498.12 ns | 2.83 immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe | 17962.12 ns | 4179.33 ns| 2010.22 ns | 2.08 immediate_just(1) + zip(immediate_just(2)) + subscribe | 8324.73 ns | 1455.38 ns| 834.94 ns | 1.74
### Subjects name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- publish_subject with 1 observer - on_next | 128.10 ns | 99.69 ns| 55.47 ns | 1.80 subscribe 100 observers to publish_subject | 700656.00 ns | 87664.77 ns| 45958.00 ns | 1.91 100 on_next to 100 observers to publish_subject | 122338.50 ns | 37618.96 ns| 21626.32 ns | 1.74
### Scenarios name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- basic sample | 6153.94 ns | 136.94 ns| 80.86 ns | 1.69 basic sample with immediate scheduler | 4948.58 ns | 36.70 ns| 22.14 ns | 1.66
### Aggregating Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+reduce(10, std::plus)+subscribe | 5032.49 ns | 0.38 ns| 0.28 ns | 1.38
### Error Handling Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe | 16961.48 ns | 7961.35 ns| 4580.18 ns | 1.74 create(on_error())+retry(1)+subscribe | 3196.80 ns | 808.36 ns| 294.48 ns | 2.75
## ci-ubuntu-clang
### General name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- Subscribe empty callbacks to empty observable | 268.87 ns | 1.54 ns| 1.57 ns | 0.98 Subscribe empty callbacks to empty observable via pipe operator | 269.76 ns | 1.54 ns| 1.56 ns | 0.99
### Sources name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- from array of 1 - create + subscribe + immediate | 572.94 ns | 0.31 ns| 0.31 ns | 1.00 from array of 1 - create + subscribe + current_thread | 796.83 ns | 4.01 ns| 4.33 ns | 0.93 concat_as_source of just(1 immediate) create + subscribe | 2370.28 ns | 195.46 ns| 131.79 ns | 1.48 defer from array of 1 - defer + create + subscribe + immediate | 776.11 ns | 0.31 ns| 0.31 ns | 1.00 interval - interval + take(3) + subscribe + immediate | 2212.05 ns | 58.31 ns| 58.26 ns | 1.00 interval - interval + take(3) + subscribe + current_thread | 3187.42 ns | 30.88 ns| 30.86 ns | 1.00 from array of 1 - create + as_blocking + subscribe + new_thread | 29355.80 ns | 31416.84 ns| 35202.59 ns | 0.89 from array of 1000 - create + as_blocking + subscribe + new_thread | 37845.66 ns | 35611.30 ns| 41525.30 ns | 0.86 concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe | 3655.58 ns | 313.49 ns| 149.63 ns | 2.10
### Filtering Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+take(1)+subscribe | 1152.57 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just+filter(true)+subscribe | 847.75 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just(1,2)+skip(1)+subscribe | 1072.79 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just(1,1,2)+distinct_until_changed()+subscribe | 876.52 ns | 0.32 ns| 0.31 ns | 1.04 immediate_just(1,2)+first()+subscribe | 1358.56 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just(1,2)+last()+subscribe | 998.56 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just+take_last(1)+subscribe | 1190.55 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just(1,2,3)+element_at(1)+subscribe | 870.48 ns | 0.31 ns| 0.31 ns | 1.01
### Schedulers name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate scheduler create worker + schedule | 277.40 ns | 1.55 ns| 1.56 ns | 0.99 current_thread scheduler create worker + schedule | 390.60 ns | 4.58 ns| 4.94 ns | 0.93 current_thread scheduler create worker + schedule + recursive schedule | 862.21 ns | 56.48 ns| 55.77 ns | 1.01
### Transforming Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+map(v*2)+subscribe | 846.36 ns | 0.31 ns| 0.31 ns | 1.00 immediate_just+scan(10, std::plus)+subscribe | 957.20 ns | 0.62 ns| 0.31 ns | 2.00 immediate_just+flat_map(immediate_just(v*2))+subscribe | 2222.48 ns | 172.69 ns| 137.52 ns | 1.26 immediate_just+buffer(2)+subscribe | 1523.31 ns | 13.59 ns| 13.58 ns | 1.00 immediate_just+window(2)+subscribe + subscsribe inner | 2460.57 ns | 918.07 ns| 955.31 ns | 0.96
### Conditional Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+take_while(false)+subscribe | 837.04 ns | -| - | 0.00 immediate_just+take_while(true)+subscribe | 850.50 ns | 0.31 ns| 0.31 ns | 1.00
### Utility Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just(1)+subscribe_on(immediate)+subscribe | 2000.29 ns | 0.31 ns| 0.31 ns | 1.00
### Combining Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe | 3272.73 ns | 202.06 ns| 158.27 ns | 1.28 immediate_just(1) + merge_with(immediate_just(2)) + subscribe | 3741.73 ns | 160.43 ns| 145.99 ns | 1.10 immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe | - | 197.13 ns| 143.48 ns | 1.37 immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe | 3331.75 ns | 841.55 ns| 843.78 ns | 1.00 immediate_just(1) + zip(immediate_just(2)) + subscribe | 2268.17 ns | 161.62 ns| 201.13 ns | 0.80
### Subjects name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- publish_subject with 1 observer - on_next | 53.87 ns | 17.87 ns| 17.52 ns | 1.02 subscribe 100 observers to publish_subject | 209278.33 ns | 15968.00 ns| 16102.09 ns | 0.99 100 on_next to 100 observers to publish_subject | 42716.22 ns | 20571.22 ns| 20592.25 ns | 1.00
### Scenarios name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- basic sample | 1296.26 ns | 11.11 ns| 11.72 ns | 0.95 basic sample with immediate scheduler | 1278.40 ns | 5.86 ns| 6.17 ns | 0.95
### Aggregating Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+reduce(10, std::plus)+subscribe | 994.37 ns | 0.31 ns| 0.31 ns | 1.00
### Error Handling Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe | 2156.71 ns | 1021.07 ns| 1240.12 ns | 0.82 create(on_error())+retry(1)+subscribe | 652.80 ns | 160.11 ns| 138.40 ns | 1.16
## ci-windows
### General name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- Subscribe empty callbacks to empty observable | 565.29 ns | 4.02 ns| 4.01 ns | 1.00 Subscribe empty callbacks to empty observable via pipe operator | 585.15 ns | 4.01 ns| 4.01 ns | 1.00
### Sources name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- from array of 1 - create + subscribe + immediate | 1149.04 ns | 9.71 ns| 9.63 ns | 1.01 from array of 1 - create + subscribe + current_thread | 1423.42 ns | 17.92 ns| 17.91 ns | 1.00 concat_as_source of just(1 immediate) create + subscribe | 3740.85 ns | 253.26 ns| 189.21 ns | 1.34 defer from array of 1 - defer + create + subscribe + immediate | 1194.03 ns | 9.41 ns| 9.41 ns | 1.00 interval - interval + take(3) + subscribe + immediate | 2980.40 ns | 145.27 ns| 145.29 ns | 1.00 interval - interval + take(3) + subscribe + current_thread | 3432.95 ns | 67.07 ns| 65.06 ns | 1.03 from array of 1 - create + as_blocking + subscribe + new_thread | 119933.33 ns | 109363.64 ns| 113920.00 ns | 0.96 from array of 1000 - create + as_blocking + subscribe + new_thread | 126577.78 ns | 141050.00 ns| 121444.44 ns | 1.16 concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe | 5314.55 ns | 318.25 ns| 207.64 ns | 1.53
### Filtering Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+take(1)+subscribe | 1808.54 ns | 25.30 ns| 25.30 ns | 1.00 immediate_just+filter(true)+subscribe | 1299.09 ns | 24.37 ns| 25.50 ns | 0.96 immediate_just(1,2)+skip(1)+subscribe | 1719.16 ns | 24.07 ns| 24.07 ns | 1.00 immediate_just(1,1,2)+distinct_until_changed()+subscribe | 1339.71 ns | 29.01 ns| 29.01 ns | 1.00 immediate_just(1,2)+first()+subscribe | 2316.97 ns | 22.83 ns| 23.38 ns | 0.98 immediate_just(1,2)+last()+subscribe | 1800.70 ns | 24.07 ns| 24.07 ns | 1.00 immediate_just+take_last(1)+subscribe | 2041.67 ns | 69.73 ns| 128.77 ns | 0.54 immediate_just(1,2,3)+element_at(1)+subscribe | 1333.26 ns | 27.46 ns| 27.46 ns | 1.00
### Schedulers name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate scheduler create worker + schedule | 475.53 ns | 6.17 ns| 6.18 ns | 1.00 current_thread scheduler create worker + schedule | 649.20 ns | 13.97 ns| 14.19 ns | 0.98 current_thread scheduler create worker + schedule + recursive schedule | 1351.29 ns | 103.33 ns| 104.44 ns | 0.99
### Transforming Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+map(v*2)+subscribe | 1311.88 ns | 24.37 ns| 24.35 ns | 1.00 immediate_just+scan(10, std::plus)+subscribe | 1419.38 ns | 26.84 ns| 26.84 ns | 1.00 immediate_just+flat_map(immediate_just(v*2))+subscribe | 3840.74 ns | 359.27 ns| 204.70 ns | 1.76 immediate_just+buffer(2)+subscribe | 2333.68 ns | 70.92 ns| 71.11 ns | 1.00 immediate_just+window(2)+subscribe + subscsribe inner | 4019.93 ns | 1319.50 ns| 1277.04 ns | 1.03
### Conditional Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+take_while(false)+subscribe | 1296.04 ns | 23.12 ns| 23.12 ns | 1.00 immediate_just+take_while(true)+subscribe | 1528.84 ns | 24.35 ns| 24.36 ns | 1.00
### Utility Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just(1)+subscribe_on(immediate)+subscribe | 3494.33 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 | 5061.71 ns | 423.63 ns| 224.47 ns | 1.89 immediate_just(1) + merge_with(immediate_just(2)) + subscribe | 5389.59 ns | 325.98 ns| 211.43 ns | 1.54 immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe | - | 301.38 ns| 197.55 ns | 1.53 immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe | 5262.95 ns | 955.17 ns| 923.25 ns | 1.03 immediate_just(1) + zip(immediate_just(2)) + subscribe | 3547.83 ns | 549.50 ns| 536.47 ns | 1.02
### Subjects name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- publish_subject with 1 observer - on_next | 37.51 ns | 20.70 ns| 20.66 ns | 1.00 subscribe 100 observers to publish_subject | 306275.00 ns | 29669.44 ns| 30131.58 ns | 0.98 100 on_next to 100 observers to publish_subject | 52242.11 ns | 38824.14 ns| 38819.23 ns | 1.00
### Scenarios name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- basic sample | 1874.52 ns | 101.35 ns| 102.37 ns | 0.99 basic sample with immediate scheduler | 1868.92 ns | 73.98 ns| 74.11 ns | 1.00
### Aggregating Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- immediate_just+reduce(10, std::plus)+subscribe | 1447.32 ns | 24.97 ns| 24.97 ns | 1.00
### Error Handling Operators name | rxcpp | rpp | prev rpp | ratio --- | --- | --- | --- | --- create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe | 2186.53 ns | 246.77 ns| 349.11 ns | 0.71 create(on_error())+retry(1)+subscribe | 1164.40 ns | 193.38 ns| 185.37 ns | 1.04
sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
48.1% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 97.63780% with 3 lines in your changes missing coverage. Please review.

Project coverage is 95.45%. Comparing base (ed65786) to head (499ba4f). Report is 1 commits behind head on v2.

Files with missing lines Patch % Lines
src/rpp/rpp/operators/debounce.hpp 93.33% 1 Missing :warning:
src/rpp/rpp/operators/delay.hpp 96.15% 1 Missing :warning:
src/rpp/rpp/operators/retry_when.hpp 87.50% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## v2 #640 +/- ## ========================================== - Coverage 95.64% 95.45% -0.19% ========================================== Files 97 97 Lines 1883 1850 -33 ========================================== - Hits 1801 1766 -35 - Misses 82 84 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.