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

debug disposable #665

Closed
wants to merge 2 commits into from
Closed

debug disposable #665

wants to merge 2 commits into from

Conversation

victimsnino
Copy link
Owner

@victimsnino victimsnino commented Oct 16, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new job for testing the RPP package in the CI workflow.
    • Added documentation generation and deployment to GitHub Pages.
  • Bug Fixes

    • Enhanced testing logic to verify disposable state during observable completion.
  • Chores

    • Updated CI workflow with improved job definitions and configurations for various operating systems.
    • Implemented conditional compilation for optimization control during debugging.

Copy link

coderabbitai bot commented Oct 16, 2024

📝 Walkthrough

Walkthrough

The changes in this pull request primarily involve updates to the Continuous Integration (CI) configuration and enhancements to the codebase. The CI workflow has been refined to include new job definitions, matrix strategies for various build configurations, and improved caching mechanisms. Additionally, conditional compilation directives have been introduced in specific function templates to allow for debugging optimizations. A new test case has been added to validate the lifecycle of disposables within observables.

Changes

File Path Change Summary
.github/workflows/ci v2.yml - Added new job: use_rpp_as_package
- Modified jobs: cache_deps, sanitize, tests, docs with matrix strategies and updated steps.
src/rpp/rpp/observables/details/disposable_strategy.hpp - Updated deduce_updated_disposable_strategy with conditional compilation for RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION.
src/rpp/rpp/observers/details/fwd.hpp - Updated deduce_disposable_strategy with conditional compilation for RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION.
src/tests/utils/disposable_observable.hpp - Enhanced test_operator_over_observable_with_disposable to check disposable state before on_completed.

Possibly related PRs

  • Doxygen updates #647: The changes in the main PR regarding the CI workflow enhancements, particularly the introduction of a new job for building Doxygen documentation, relate to the Doxygen updates in this PR.
  • try to speedup cache #663: The modifications to the caching mechanism in the CI workflow in the main PR are directly related to the updates made to the caching strategy in this PR, which also focuses on improving cache management in the CI configuration.

🐰 In the meadow, where bunnies hop,
CI workflows now take a top!
With jobs that build and tests that shine,
Optimization's here, oh so fine!
Let's celebrate with a joyful cheer,
For every change brings us near! 🌼


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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0928df1 and fef90cc.

📒 Files selected for processing (4)
  • .github/workflows/ci v2.yml (1 hunks)
  • src/rpp/rpp/observables/details/disposable_strategy.hpp (1 hunks)
  • src/rpp/rpp/observers/details/fwd.hpp (1 hunks)
  • src/tests/utils/disposable_observable.hpp (1 hunks)
🧰 Additional context used
🔇 Additional comments (3)
.github/workflows/ci v2.yml (1)

180-180: LGTM! Consider verifying the impact on test execution time.

The addition of -DRPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION=1 to disable disposables optimization in debug mode is appropriate for debugging purposes. This change aligns well with the PR objective of debugging disposables.

To ensure this change doesn't significantly impact test execution time, consider running the following script:

This script will help you assess any potential performance impact on the test suite.

src/tests/utils/disposable_observable.hpp (1)

131-133: Excellent addition to the test case!

The new check CHECK(!d.is_disposed()); before calling on_completed() significantly improves the test coverage. It ensures that the disposable is not prematurely disposed before the observable completes, which is crucial for validating the correct lifecycle of disposables within observables.

This change enhances the test by verifying both the initial state (not disposed) and the final state (disposed) of the disposable, providing a more comprehensive validation of the disposable's behavior.

src/rpp/rpp/observers/details/fwd.hpp (1)

75-79: ⚠️ Potential issue

Fix mismatched preprocessor directives and control flow

There appears to be a mismatch between the #ifndef/#endif directives and the if constexpr statement. The #endif is placed immediately after the else, which can lead to compilation errors because the else has no corresponding if in this context.

Consider restructuring the preprocessor directives to properly encapsulate the entire if constexpr...else block.

Apply this diff to correct the issue:

#ifndef RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION
    if constexpr (has_disposable_strategy<T>)
        return static_cast<typename T::preferred_disposable_strategy*>(nullptr);
    else
        return static_cast<dynamic_local_disposable_strategy<0, atomic_bool>*>(nullptr);
#else
    return static_cast<dynamic_local_disposable_strategy<0, atomic_bool>*>(nullptr);
#endif

This adjustment ensures that when RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION is not defined, the function uses the if constexpr logic. When the macro is defined, it always returns the default disposable strategy.

Please verify that the updated preprocessor directives maintain the intended control flow and that the code compiles without errors.

Comment on lines +96 to +100
#ifndef RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION
if constexpr (has_updated_disposable_strategy<T, Prev>)
return static_cast<typename T::template updated_disposable_strategy<Prev>*>(nullptr);
else
#endif
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the preprocessor directives to prevent syntax errors

The else statement following the if constexpr is outside of the #ifndef and #endif block. This can lead to a syntax error when RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION is defined because the else would not have a matching if.

To resolve this issue, adjust the preprocessor directives so that both the if constexpr and the corresponding else are enclosed within the #ifndef block. Here are two ways to fix it:

Option 1: Include else within the #ifndef block

 template<typename T, typename Prev>
 consteval auto* deduce_updated_disposable_strategy()
 {
-#ifndef RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION
     if constexpr (has_updated_disposable_strategy<T, Prev>)
         return static_cast<typename T::template updated_disposable_strategy<Prev>*>(nullptr);
+    else
+        return static_cast<default_disposable_strategy_selector*>(nullptr);
-#endif
+}
+#else
+    return static_cast<default_disposable_strategy_selector*>(nullptr);
 #endif
 }

Option 2: Move the default return outside the #ifndef block

template<typename T, typename Prev>
consteval auto* deduce_updated_disposable_strategy()
{
#ifndef RPP_DEBUG_DISABLE_DISPOSABLES_OPTIMIZATION
    if constexpr (has_updated_disposable_strategy<T, Prev>)
        return static_cast<typename T::template updated_disposable_strategy<Prev>*>(nullptr);
    else
#endif
    return static_cast<default_disposable_strategy_selector*>(nullptr);
}

Copy link
Contributor

BENCHMARK RESULTS (AUTOGENERATED)

ci-ubuntu-gcc

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 300.30 ns 2.16 ns 2.16 ns 1.00
Subscribe empty callbacks to empty observable via pipe operator 306.07 ns 2.16 ns 2.16 ns 1.00

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 687.45 ns 0.31 ns 0.31 ns 1.00
from array of 1 - create + subscribe + current_thread 1031.80 ns 3.71 ns 3.70 ns 1.00
concat_as_source of just(1 immediate) create + subscribe 2283.60 ns 142.68 ns 143.01 ns 1.00
defer from array of 1 - defer + create + subscribe + immediate 744.07 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2197.15 ns 59.19 ns 59.19 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3071.51 ns 32.40 ns 32.40 ns 1.00
from array of 1 - create + as_blocking + subscribe + new_thread 27490.51 ns 27811.65 ns 28314.95 ns 0.98
from array of 1000 - create + as_blocking + subscribe + new_thread 41645.61 ns 51348.35 ns 49169.86 ns 1.04
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3514.13 ns 216.91 ns 218.58 ns 0.99

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1663.34 ns 0.58 ns 0.31 ns 1.87
immediate_just+filter(true)+subscribe 926.86 ns 0.32 ns 0.31 ns 1.04
immediate_just(1,2)+skip(1)+subscribe 1013.97 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 843.27 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+first()+subscribe 1258.87 ns 0.32 ns 0.31 ns 1.04
immediate_just(1,2)+last()+subscribe 913.94 ns 0.31 ns 0.31 ns 1.00
immediate_just+take_last(1)+subscribe 1673.11 ns 32.18 ns 18.52 ns 1.74
immediate_just(1,2,3)+element_at(1)+subscribe 825.90 ns 0.31 ns 0.31 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 264.75 ns 2.16 ns 2.16 ns 1.00
current_thread scheduler create worker + schedule 366.80 ns 5.87 ns 5.87 ns 1.00
current_thread scheduler create worker + schedule + recursive schedule 815.68 ns 55.81 ns 55.29 ns 1.01

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 868.12 ns 0.31 ns 0.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 901.30 ns 0.31 ns 0.31 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 2398.08 ns 197.29 ns 195.69 ns 1.01
immediate_just+buffer(2)+subscribe 1616.33 ns 14.82 ns 14.20 ns 1.04
immediate_just+window(2)+subscribe + subscsribe inner 3834.29 ns 1473.01 ns 1334.23 ns 1.10

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 840.57 ns - - 0.00
immediate_just+take_while(true)+subscribe 849.22 ns 0.31 ns 0.31 ns 1.00

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2060.33 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 3447.29 ns 237.32 ns 238.12 ns 1.00
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3642.47 ns 193.19 ns 192.84 ns 1.00
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 181.48 ns 179.05 ns 1.01
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3567.95 ns 1270.91 ns 1258.00 ns 1.01
immediate_just(1) + zip(immediate_just(2)) + subscribe 2238.52 ns 231.27 ns 228.10 ns 1.01

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 34.48 ns 14.64 ns 14.63 ns 1.00
subscribe 100 observers to publish_subject 197927.83 ns 16135.27 ns 16010.15 ns 1.01
100 on_next to 100 observers to publish_subject 27144.00 ns 17103.46 ns 17179.33 ns 1.00

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1413.03 ns 12.68 ns 12.65 ns 1.00
basic sample with immediate scheduler 1355.18 ns 5.55 ns 5.56 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 936.77 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 2105.25 ns 926.00 ns 911.08 ns 1.02
create(on_error())+retry(1)+subscribe 658.16 ns 121.70 ns 121.43 ns 1.00

ci-macos

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 1165.57 ns 4.78 ns 5.30 ns 0.90
Subscribe empty callbacks to empty observable via pipe operator 1170.77 ns 4.68 ns 8.19 ns 0.57

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 2238.72 ns 0.27 ns 0.67 ns 0.41
from array of 1 - create + subscribe + current_thread 2723.38 ns 36.68 ns 53.38 ns 0.69
concat_as_source of just(1 immediate) create + subscribe 6473.05 ns 515.32 ns 836.98 ns 0.62
defer from array of 1 - defer + create + subscribe + immediate 2234.22 ns 0.27 ns 0.51 ns 0.53
interval - interval + take(3) + subscribe + immediate 5609.05 ns 129.15 ns 154.76 ns 0.83
interval - interval + take(3) + subscribe + current_thread 6989.04 ns 108.83 ns 163.81 ns 0.66
from array of 1 - create + as_blocking + subscribe + new_thread 96661.27 ns 98906.50 ns 128427.90 ns 0.77
from array of 1000 - create + as_blocking + subscribe + new_thread 133914.00 ns 107844.73 ns 136014.00 ns 0.79
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 9486.26 ns 693.91 ns 1080.91 ns 0.64

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 3267.96 ns 0.27 ns 0.32 ns 0.85
immediate_just+filter(true)+subscribe 2324.88 ns 0.26 ns 0.32 ns 0.84
immediate_just(1,2)+skip(1)+subscribe 3104.23 ns 0.27 ns 0.32 ns 0.84
immediate_just(1,1,2)+distinct_until_changed()+subscribe 2339.44 ns 0.53 ns 0.63 ns 0.84
immediate_just(1,2)+first()+subscribe 3592.43 ns 0.27 ns 0.32 ns 0.84
immediate_just(1,2)+last()+subscribe 2681.24 ns 0.26 ns 0.32 ns 0.84
immediate_just+take_last(1)+subscribe 3408.52 ns 0.26 ns 0.32 ns 0.84
immediate_just(1,2,3)+element_at(1)+subscribe 2266.55 ns 0.26 ns 0.32 ns 0.84

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 1022.23 ns 5.12 ns 9.08 ns 0.56
current_thread scheduler create worker + schedule 1397.20 ns 43.25 ns 56.33 ns 0.77
current_thread scheduler create worker + schedule + recursive schedule 2186.77 ns 235.70 ns 275.78 ns 0.85

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 2505.58 ns 5.02 ns 5.98 ns 0.84
immediate_just+scan(10, std::plus)+subscribe 2645.82 ns 0.54 ns 0.66 ns 0.82
immediate_just+flat_map(immediate_just(v*2))+subscribe 6255.50 ns 605.16 ns 783.70 ns 0.77
immediate_just+buffer(2)+subscribe 2808.73 ns 74.24 ns 99.66 ns 0.74
immediate_just+window(2)+subscribe + subscsribe inner 6183.30 ns 2745.94 ns 3253.48 ns 0.84

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 2251.57 ns - - 0.00
immediate_just+take_while(true)+subscribe 2431.50 ns 0.26 ns 0.32 ns 0.84

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 5427.31 ns 5.52 ns 6.60 ns 0.84

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 7901.88 ns 637.99 ns 1081.23 ns 0.59
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 8967.59 ns 548.12 ns 979.50 ns 0.56
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 629.95 ns 827.86 ns 0.76
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 8569.44 ns 2043.43 ns 2689.56 ns 0.76
immediate_just(1) + zip(immediate_just(2)) + subscribe 5501.50 ns 1006.54 ns 1253.22 ns 0.80

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 87.81 ns 58.35 ns 66.23 ns 0.88
subscribe 100 observers to publish_subject 381298.67 ns 45140.09 ns 55324.71 ns 0.82
100 on_next to 100 observers to publish_subject 61489.76 ns 20797.92 ns 25480.70 ns 0.82

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 3378.61 ns 80.98 ns 91.36 ns 0.89
basic sample with immediate scheduler 3026.23 ns 20.88 ns 25.18 ns 0.83

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 2651.84 ns 0.26 ns 0.32 ns 0.82

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 7611.72 ns 4513.60 ns 5262.32 ns 0.86
create(on_error())+retry(1)+subscribe 1992.77 ns 407.17 ns 490.99 ns 0.83

ci-ubuntu-clang

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 267.18 ns 0.88 ns 1.56 ns 0.56
Subscribe empty callbacks to empty observable via pipe operator 281.96 ns 0.88 ns 1.56 ns 0.56

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 558.65 ns 0.31 ns 0.31 ns 1.00
from array of 1 - create + subscribe + current_thread 789.65 ns 4.01 ns 4.01 ns 1.00
concat_as_source of just(1 immediate) create + subscribe 2388.53 ns 182.39 ns 185.91 ns 0.98
defer from array of 1 - defer + create + subscribe + immediate 763.93 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2207.11 ns 58.46 ns 58.26 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3156.23 ns 30.86 ns 30.91 ns 1.00
from array of 1 - create + as_blocking + subscribe + new_thread 31085.38 ns 29133.37 ns 27876.89 ns 1.05
from array of 1000 - create + as_blocking + subscribe + new_thread 40630.92 ns 35810.07 ns 36852.00 ns 0.97
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3669.10 ns 306.36 ns 300.96 ns 1.02

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1149.79 ns 0.31 ns 0.31 ns 1.00
immediate_just+filter(true)+subscribe 844.32 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 1062.16 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 866.02 ns 0.33 ns 0.31 ns 1.07
immediate_just(1,2)+first()+subscribe 1364.12 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+last()+subscribe 995.30 ns 0.31 ns 0.31 ns 1.00
immediate_just+take_last(1)+subscribe 1187.04 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2,3)+element_at(1)+subscribe 879.33 ns 0.31 ns 0.31 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 278.28 ns 0.88 ns 1.56 ns 0.56
current_thread scheduler create worker + schedule 391.62 ns 4.32 ns 4.32 ns 1.00
current_thread scheduler create worker + schedule + recursive schedule 858.49 ns 55.16 ns 57.05 ns 0.97

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 836.15 ns 0.31 ns 0.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 955.31 ns 0.31 ns 0.31 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 3007.87 ns 231.04 ns 233.32 ns 0.99
immediate_just+buffer(2)+subscribe 1541.04 ns 13.89 ns 13.91 ns 1.00
immediate_just+window(2)+subscribe + subscsribe inner 2406.51 ns 939.48 ns 930.44 ns 1.01

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 825.08 ns - - 0.00
immediate_just+take_while(true)+subscribe 850.68 ns 0.31 ns 0.31 ns 1.00

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 1984.16 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 3257.39 ns 291.04 ns 290.67 ns 1.00
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3721.55 ns 214.82 ns 217.37 ns 0.99
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 198.97 ns 200.04 ns 0.99
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3393.11 ns 850.04 ns 840.38 ns 1.01
immediate_just(1) + zip(immediate_just(2)) + subscribe 2211.97 ns 197.61 ns 198.02 ns 1.00

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 52.43 ns 17.94 ns 17.90 ns 1.00
subscribe 100 observers to publish_subject 209854.00 ns 15915.98 ns 15999.74 ns 0.99
100 on_next to 100 observers to publish_subject 40789.89 ns 17546.17 ns 20447.98 ns 0.86

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1296.44 ns 11.42 ns 11.42 ns 1.00
basic sample with immediate scheduler 1284.61 ns 6.17 ns 6.17 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 986.58 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 2166.20 ns 1009.99 ns 1009.30 ns 1.00
create(on_error())+retry(1)+subscribe 647.60 ns 158.44 ns 158.49 ns 1.00

ci-windows

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 557.98 ns 4.01 ns 4.94 ns 0.81
Subscribe empty callbacks to empty observable via pipe operator 578.72 ns 4.01 ns 4.94 ns 0.81

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1158.05 ns 9.71 ns 9.64 ns 1.01
from array of 1 - create + subscribe + current_thread 1425.22 ns 17.90 ns 17.74 ns 1.01
concat_as_source of just(1 immediate) create + subscribe 3709.00 ns 237.25 ns 234.08 ns 1.01
defer from array of 1 - defer + create + subscribe + immediate 1189.79 ns 9.43 ns 9.41 ns 1.00
interval - interval + take(3) + subscribe + immediate 3269.75 ns 145.41 ns 144.28 ns 1.01
interval - interval + take(3) + subscribe + current_thread 3486.97 ns 65.12 ns 65.15 ns 1.00
from array of 1 - create + as_blocking + subscribe + new_thread 119360.00 ns 111170.00 ns 114875.00 ns 0.97
from array of 1000 - create + as_blocking + subscribe + new_thread 126037.50 ns 131188.89 ns 133800.00 ns 0.98
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 5385.86 ns 312.27 ns 309.92 ns 1.01

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1822.71 ns 25.28 ns 24.97 ns 1.01
immediate_just+filter(true)+subscribe 1314.76 ns 24.37 ns 24.06 ns 1.01
immediate_just(1,2)+skip(1)+subscribe 1731.80 ns 24.06 ns 23.44 ns 1.03
immediate_just(1,1,2)+distinct_until_changed()+subscribe 1341.28 ns 28.99 ns 26.22 ns 1.11
immediate_just(1,2)+first()+subscribe 2326.93 ns 22.82 ns 23.74 ns 0.96
immediate_just(1,2)+last()+subscribe 1736.50 ns 24.06 ns 24.66 ns 0.98
immediate_just+take_last(1)+subscribe 2015.41 ns 70.57 ns 71.37 ns 0.99
immediate_just(1,2,3)+element_at(1)+subscribe 1345.28 ns 27.68 ns 26.53 ns 1.04

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 475.59 ns 6.17 ns 6.17 ns 1.00
current_thread scheduler create worker + schedule 644.70 ns 13.93 ns 14.42 ns 0.97
current_thread scheduler create worker + schedule + recursive schedule 1084.05 ns 104.11 ns 101.80 ns 1.02

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 1304.05 ns 24.35 ns 24.37 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 1436.66 ns 26.54 ns 26.53 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 3859.63 ns 271.29 ns 267.32 ns 1.01
immediate_just+buffer(2)+subscribe 2307.87 ns 68.91 ns 69.43 ns 0.99
immediate_just+window(2)+subscribe + subscsribe inner 4055.51 ns 1323.15 ns 1320.22 ns 1.00

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 1316.94 ns 23.12 ns 23.14 ns 1.00
immediate_just+take_while(true)+subscribe 1332.94 ns 24.35 ns 24.05 ns 1.01

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 3773.54 ns 11.10 ns 11.10 ns 1.00

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 5057.69 ns 309.38 ns 303.50 ns 1.02
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 5425.12 ns 266.98 ns 264.10 ns 1.01
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 305.32 ns 333.79 ns 0.91
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 5250.46 ns 941.61 ns 939.80 ns 1.00
immediate_just(1) + zip(immediate_just(2)) + subscribe 3457.66 ns 566.95 ns 604.01 ns 0.94

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 36.68 ns 20.18 ns 20.05 ns 1.01
subscribe 100 observers to publish_subject 300333.33 ns 29510.26 ns 31585.29 ns 0.93
100 on_next to 100 observers to publish_subject 54894.74 ns 32622.86 ns 32631.43 ns 1.00

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1876.07 ns 103.23 ns 102.25 ns 1.01
basic sample with immediate scheduler 1879.60 ns 74.82 ns 73.90 ns 1.01

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1468.34 ns 24.97 ns 24.66 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 1934.28 ns 256.12 ns 251.32 ns 1.02
create(on_error())+retry(1)+subscribe 1471.27 ns 191.87 ns 192.27 ns 1.00

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.28%. Comparing base (0928df1) to head (fef90cc).

Additional details and impacted files
@@           Coverage Diff           @@
##               v2     #665   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files         154      154           
  Lines        7717     7718    +1     
=======================================
+ Hits         7585     7586    +1     
  Misses        132      132           

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

Copy link

sonarcloud bot commented Oct 16, 2024

@victimsnino victimsnino deleted the debug_disposable branch October 18, 2024 13:55
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.

1 participant