Skip to content

extend coverage#657

Merged
AlexInLog merged 3 commits into
v2from
extend_coverage
Oct 9, 2024
Merged

extend coverage#657
AlexInLog merged 3 commits into
v2from
extend_coverage

Conversation

@AlexInLog

@AlexInLog AlexInLog commented Oct 8, 2024

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Introduced a new test case to enhance the ReactivePlusPlus library's observer functionality, ensuring proper handling of exceptions during the on_next method.
  • Tests

    • Added a test case titled "on_error if exception during on_next" to verify the behavior of observers under exception conditions.
    • Updated method signatures in the mock_observer class to improve exception handling capabilities.

@coderabbitai

coderabbitai Bot commented Oct 8, 2024

Copy link
Copy Markdown
Contributor
📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes introduce a new test case to the ReactivePlusPlus library's test suite, specifically in the test_observers.cpp file. This test case, titled on_error if exception during on_next, verifies the behavior of an observer when an exception occurs during the on_next method. It includes two subcases for rvalue and lvalue handling, utilizing the Trompeloeil mocking framework to set expectations on the observer's methods. Additionally, modifications are made to the mock_observer class in rpp_trompeloil.hpp by removing the noexcept specifier from the on_next method signatures.

Changes

File Path Change Summary
src/tests/rpp/test_observers.cpp Added new test case on_error if exception during on_next and included rpp_trompeloil.hpp.
src/tests/utils/rpp_trompeloil.hpp Updated on_next method signatures by removing noexcept.

Poem

In the land of tests, where rabbits play,
A new case hops in, brightening the day.
When on_next throws, and errors arise,
The observer calls on_error, oh what a surprise!
With Trompeloeil's magic, we ensure it's right,
In the world of code, everything's tight! 🐇✨


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
src/tests/rpp/test_observers.cpp (1)

298-318: LGTM: Comprehensive test case for exception handling during on_next.

This test case effectively verifies that exceptions thrown during on_next are properly handled by calling on_error for both rvalue and lvalue scenarios. The use of Trompeloeil for mocking and sequencing is appropriate.

Suggestions for improvement:

  1. Consider adding a meaningful error message to the thrown exception, e.g., throw std::runtime_error{"Error during on_next"};.
  2. Verify the content of the error passed to on_error to ensure it matches the thrown exception.

Example for point 2:

REQUIRE_CALL(*observer, on_error(trompeloeil::_))
    .LR_SIDE_EFFECT(
        try {
            std::rethrow_exception(_1);
        } catch (const std::runtime_error& e) {
            REQUIRE(std::string(e.what()) == "Error during on_next");
        }
    )
    .IN_SEQUENCE(s);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b5bd748 and 96d82ed.

📒 Files selected for processing (1)
  • src/tests/rpp/test_observers.cpp (2 hunks)
🧰 Additional context used
🔇 Additional comments (1)
src/tests/rpp/test_observers.cpp (1)

15-15: LGTM: New include for Trompeloeil mocking framework.

The addition of #include "rpp_trompeloil.hpp" is appropriate for introducing the Trompeloeil mocking framework to the test file. This will enable more sophisticated mocking capabilities in the new test case.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
src/tests/utils/rpp_trompeloil.hpp (1)

36-39: Document the removal of noexcept specifier

The noexcept specifier has been removed from the on_next method for rvalue references, consistent with the change made to the lvalue reference version. This change allows for more flexible testing scenarios where exceptions might be thrown during on_next calls.

Consider adding a comment above both on_next methods to explain why the noexcept specifier was removed. This will help future maintainers understand the intentionality behind this change. For example:

// `noexcept` specifier removed to allow testing of exception scenarios in `on_next` calls
void on_next(const T& v) const
{
    m_impl->on_next_lvalue(v);
}

// `noexcept` specifier removed to allow testing of exception scenarios in `on_next` calls
void on_next(T&& v) const
{
    m_impl->on_next_rvalue(std::move(v));
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 96d82ed and a979aa5.

📒 Files selected for processing (2)
  • src/tests/rpp/test_observers.cpp (2 hunks)
  • src/tests/utils/rpp_trompeloil.hpp (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/tests/rpp/test_observers.cpp
🧰 Additional context used
🔇 Additional comments (2)
src/tests/utils/rpp_trompeloil.hpp (2)

31-39: Verify impact on existing tests and mock usage

The removal of noexcept from both on_next methods is a significant change that may affect how the mock_observer is used in tests. While this change allows for testing exception scenarios, it's important to ensure that it doesn't inadvertently break existing tests or introduce inconsistencies with the real observer's behavior.

Please review the existing test suite to confirm that:

  1. This change doesn't break any existing tests that may have been relying on the noexcept behavior.
  2. The mock observer's behavior still accurately represents the real observer's behavior in all test scenarios.

Consider running the following command to check for any test failures or warnings after this change:

#!/bin/bash
# Description: Run tests and check for failures or warnings

# Test: Run the test suite and capture the output
cmake --build . --target test 2>&1 | tee test_output.log

# Check for test failures or warnings
grep -E "FAILED|Warning" test_output.log

If any issues are found, they should be addressed before merging this change.


31-34: Verify the intentional removal of noexcept specifier

The noexcept specifier has been removed from the on_next method for lvalue references. This change allows exceptions to be thrown from this method, which could be intentional for testing purposes. However, it's important to ensure that this change aligns with the expected behavior of the real observer class and doesn't introduce inconsistencies in the mocking behavior.

Please confirm if this change is intentional and aligns with the behavior of the real observer class. If it is, consider adding a comment explaining the rationale behind this change to improve code maintainability.

@github-actions

github-actions Bot commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

BENCHMARK RESULTS (AUTOGENERATED)

ci-ubuntu-gcc

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 303.61 ns 2.19 ns 2.16 ns 1.01
Subscribe empty callbacks to empty observable via pipe operator 306.22 ns 2.18 ns 2.16 ns 1.01

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 711.04 ns 0.31 ns 0.31 ns 1.01
from array of 1 - create + subscribe + current_thread 1036.15 ns 3.73 ns 3.70 ns 1.01
concat_as_source of just(1 immediate) create + subscribe 2241.66 ns 152.04 ns 149.74 ns 1.02
defer from array of 1 - defer + create + subscribe + immediate 735.33 ns 0.31 ns 0.31 ns 1.01
interval - interval + take(3) + subscribe + immediate 2137.39 ns 59.62 ns 59.23 ns 1.01
interval - interval + take(3) + subscribe + current_thread 3057.07 ns 32.66 ns 32.43 ns 1.01
from array of 1 - create + as_blocking + subscribe + new_thread 27887.52 ns 29250.21 ns 28018.24 ns 1.04
from array of 1000 - create + as_blocking + subscribe + new_thread 40971.04 ns 52730.90 ns 51935.83 ns 1.02
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3531.59 ns 217.60 ns 222.84 ns 0.98

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1119.54 ns 0.31 ns 0.31 ns 1.01
immediate_just+filter(true)+subscribe 836.74 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 981.75 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,1,2)+distinct_until_changed()+subscribe 863.44 ns 0.31 ns 0.31 ns 0.99
immediate_just(1,2)+first()+subscribe 1219.50 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,2)+last()+subscribe 925.93 ns 0.31 ns 0.31 ns 1.01
immediate_just+take_last(1)+subscribe 1108.32 ns 18.34 ns 18.52 ns 0.99
immediate_just(1,2,3)+element_at(1)+subscribe 862.93 ns 0.31 ns 0.31 ns 1.01

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 264.82 ns 2.18 ns 2.16 ns 1.01
current_thread scheduler create worker + schedule 365.48 ns 5.59 ns 5.56 ns 1.01
current_thread scheduler create worker + schedule + recursive schedule 819.82 ns 56.38 ns 55.35 ns 1.02

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 837.01 ns 0.31 ns 0.31 ns 1.01
immediate_just+scan(10, std::plus)+subscribe 904.75 ns 0.31 ns 0.31 ns 1.01
immediate_just+flat_map(immediate_just(v*2))+subscribe 2360.63 ns 210.71 ns 208.76 ns 1.01
immediate_just+buffer(2)+subscribe 1550.13 ns 14.00 ns 13.89 ns 1.01
immediate_just+window(2)+subscribe + subscsribe inner 2412.98 ns 1272.80 ns 1283.69 ns 0.99

Conditional Operators

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

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2029.98 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 3429.19 ns 261.06 ns 261.15 ns 1.00
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3657.85 ns 205.37 ns 205.13 ns 1.00
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 179.75 ns 180.58 ns 1.00
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3518.21 ns 1171.99 ns 1180.58 ns 0.99
immediate_just(1) + zip(immediate_just(2)) + subscribe 2122.67 ns 203.97 ns 203.40 ns 1.00

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 34.79 ns 14.81 ns 14.83 ns 1.00
subscribe 100 observers to publish_subject 200395.33 ns 15907.03 ns 16252.85 ns 0.98
100 on_next to 100 observers to publish_subject 32698.35 ns 17244.24 ns 17165.15 ns 1.00

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1385.24 ns 13.98 ns 13.90 ns 1.01
basic sample with immediate scheduler 1440.12 ns 5.59 ns 5.55 ns 1.01

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 934.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 2059.26 ns 910.93 ns 912.00 ns 1.00
create(on_error())+retry(1)+subscribe 625.21 ns 134.52 ns 123.32 ns 1.09

ci-macos

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 998.85 ns 3.91 ns 4.85 ns 0.81
Subscribe empty callbacks to empty observable via pipe operator 997.07 ns 3.92 ns 4.49 ns 0.87

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1976.01 ns 0.23 ns 0.26 ns 0.89
from array of 1 - create + subscribe + current_thread 2500.36 ns 33.01 ns 36.84 ns 0.90
concat_as_source of just(1 immediate) create + subscribe 6325.21 ns 511.58 ns 517.14 ns 0.99
defer from array of 1 - defer + create + subscribe + immediate 1996.90 ns 0.36 ns 0.26 ns 1.36
interval - interval + take(3) + subscribe + immediate 6724.78 ns 121.65 ns 132.11 ns 0.92
interval - interval + take(3) + subscribe + current_thread 6124.11 ns 93.80 ns 119.76 ns 0.78
from array of 1 - create + as_blocking + subscribe + new_thread 92665.92 ns 84874.00 ns 93968.18 ns 0.90
from array of 1000 - create + as_blocking + subscribe + new_thread 92779.67 ns 95103.91 ns 103036.30 ns 0.92
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 11750.57 ns 796.37 ns 668.11 ns 1.19

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 3094.46 ns 0.23 ns 0.67 ns 0.35
immediate_just+filter(true)+subscribe 2321.86 ns 0.24 ns 0.88 ns 0.27
immediate_just(1,2)+skip(1)+subscribe 3859.29 ns 0.38 ns 0.81 ns 0.47
immediate_just(1,1,2)+distinct_until_changed()+subscribe 2780.10 ns 0.63 ns 1.25 ns 0.50
immediate_just(1,2)+first()+subscribe 3296.71 ns 0.33 ns 0.94 ns 0.35
immediate_just(1,2)+last()+subscribe 3198.13 ns 0.29 ns 0.72 ns 0.40
immediate_just+take_last(1)+subscribe 3158.60 ns 0.25 ns 0.82 ns 0.30
immediate_just(1,2,3)+element_at(1)+subscribe 2130.50 ns 0.23 ns 0.70 ns 0.34

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 861.84 ns 4.17 ns 4.75 ns 0.88
current_thread scheduler create worker + schedule 1209.72 ns 39.02 ns 44.89 ns 0.87
current_thread scheduler create worker + schedule + recursive schedule 2025.65 ns 264.55 ns 233.10 ns 1.13

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 2160.65 ns 4.21 ns 12.01 ns 0.35
immediate_just+scan(10, std::plus)+subscribe 2375.46 ns 0.50 ns 1.31 ns 0.38
immediate_just+flat_map(immediate_just(v*2))+subscribe 5574.60 ns 634.08 ns 2012.94 ns 0.32
immediate_just+buffer(2)+subscribe 2552.63 ns 64.42 ns 278.56 ns 0.23
immediate_just+window(2)+subscribe + subscsribe inner 5432.18 ns 2429.59 ns 6459.68 ns 0.38

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 2917.33 ns - - 0.00
immediate_just+take_while(true)+subscribe 2127.41 ns 0.24 ns 1.34 ns 0.18

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 4901.89 ns 5.14 ns 12.45 ns 0.41

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 7770.92 ns 768.35 ns 875.12 ns 0.88
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 12674.03 ns 645.95 ns 713.71 ns 0.91
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 732.54 ns 695.21 ns 1.05
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 8982.58 ns 2382.30 ns 2178.53 ns 1.09
immediate_just(1) + zip(immediate_just(2)) + subscribe 7162.42 ns 1198.34 ns 2614.77 ns 0.46

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 75.72 ns 48.78 ns 116.31 ns 0.42
subscribe 100 observers to publish_subject 350017.67 ns 40773.92 ns 136642.14 ns 0.30
100 on_next to 100 observers to publish_subject 50237.74 ns 16716.17 ns 72370.21 ns 0.23

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 2755.30 ns 67.16 ns 257.69 ns 0.26
basic sample with immediate scheduler 2762.43 ns 18.25 ns 49.68 ns 0.37

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 2376.11 ns 0.23 ns 0.66 ns 0.36

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 6542.43 ns 3968.65 ns 14132.51 ns 0.28
create(on_error())+retry(1)+subscribe 1806.58 ns 361.29 ns 1034.62 ns 0.35

ci-ubuntu-clang

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 271.36 ns 0.89 ns 1.60 ns 0.55
Subscribe empty callbacks to empty observable via pipe operator 268.27 ns 0.88 ns 1.59 ns 0.56

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 561.57 ns 0.31 ns 0.31 ns 1.00
from array of 1 - create + subscribe + current_thread 808.79 ns 4.35 ns 4.35 ns 1.00
concat_as_source of just(1 immediate) create + subscribe 2355.42 ns 192.53 ns 185.48 ns 1.04
defer from array of 1 - defer + create + subscribe + immediate 784.06 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2218.44 ns 58.72 ns 58.97 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3184.91 ns 31.09 ns 31.08 ns 1.00
from array of 1 - create + as_blocking + subscribe + new_thread 31021.38 ns 30367.43 ns 37362.00 ns 0.81
from array of 1000 - create + as_blocking + subscribe + new_thread 42387.84 ns 39105.52 ns 39617.75 ns 0.99
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3712.67 ns 308.22 ns 302.10 ns 1.02

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1154.96 ns 0.31 ns 0.31 ns 1.00
immediate_just+filter(true)+subscribe 858.77 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 1090.88 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 886.00 ns 0.62 ns 0.62 ns 1.00
immediate_just(1,2)+first()+subscribe 1380.59 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+last()+subscribe 1017.16 ns 0.31 ns 0.31 ns 1.00
immediate_just+take_last(1)+subscribe 1192.00 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2,3)+element_at(1)+subscribe 866.91 ns 0.31 ns 0.31 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 279.25 ns 0.88 ns 1.59 ns 0.56
current_thread scheduler create worker + schedule 393.13 ns 4.97 ns 4.97 ns 1.00
current_thread scheduler create worker + schedule + recursive schedule 867.56 ns 55.55 ns 58.86 ns 0.94

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 847.04 ns 0.31 ns 0.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 971.62 ns 0.33 ns 0.32 ns 1.03
immediate_just+flat_map(immediate_just(v*2))+subscribe 2247.52 ns 174.29 ns 177.05 ns 0.98
immediate_just+buffer(2)+subscribe 1544.05 ns 14.30 ns 13.99 ns 1.02
immediate_just+window(2)+subscribe + subscsribe inner 2507.05 ns 952.84 ns 1024.02 ns 0.93

Conditional Operators

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

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2005.32 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 3267.47 ns 204.32 ns 210.54 ns 0.97
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3769.48 ns 162.73 ns 166.32 ns 0.98
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 201.09 ns 198.25 ns 1.01
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3396.94 ns 852.67 ns 855.96 ns 1.00
immediate_just(1) + zip(immediate_just(2)) + subscribe 2206.42 ns 162.64 ns 162.79 ns 1.00

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 52.50 ns 17.68 ns 17.91 ns 0.99
subscribe 100 observers to publish_subject 211608.60 ns 16193.68 ns 16129.59 ns 1.00
100 on_next to 100 observers to publish_subject 46229.26 ns 17502.30 ns 20527.27 ns 0.85

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1302.38 ns 11.81 ns 11.81 ns 1.00
basic sample with immediate scheduler 1348.78 ns 6.21 ns 6.21 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1004.16 ns 0.31 ns 0.34 ns 0.92

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 2181.81 ns 1032.34 ns 1035.95 ns 1.00
create(on_error())+retry(1)+subscribe 655.11 ns 157.01 ns 158.46 ns 0.99

ci-windows

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 563.43 ns 4.32 ns 4.78 ns 0.90
Subscribe empty callbacks to empty observable via pipe operator 581.90 ns 4.32 ns 4.86 ns 0.89

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1161.08 ns 9.72 ns 9.71 ns 1.00
from array of 1 - create + subscribe + current_thread 1487.52 ns 17.90 ns 17.59 ns 1.02
concat_as_source of just(1 immediate) create + subscribe 3798.64 ns 244.36 ns 242.04 ns 1.01
defer from array of 1 - defer + create + subscribe + immediate 1185.00 ns 9.44 ns 9.41 ns 1.00
interval - interval + take(3) + subscribe + immediate 3378.24 ns 145.43 ns 144.31 ns 1.01
interval - interval + take(3) + subscribe + current_thread 3401.56 ns 69.48 ns 65.80 ns 1.06
from array of 1 - create + as_blocking + subscribe + new_thread 127075.00 ns 115180.00 ns 111866.67 ns 1.03
from array of 1000 - create + as_blocking + subscribe + new_thread 137757.14 ns 137437.50 ns 128988.89 ns 1.07
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 5337.56 ns 311.37 ns 312.92 ns 1.00

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1813.86 ns 25.30 ns 24.97 ns 1.01
immediate_just+filter(true)+subscribe 1330.25 ns 24.37 ns 24.05 ns 1.01
immediate_just(1,2)+skip(1)+subscribe 1715.33 ns 24.07 ns 23.43 ns 1.03
immediate_just(1,1,2)+distinct_until_changed()+subscribe 1645.86 ns 29.01 ns 26.23 ns 1.11
immediate_just(1,2)+first()+subscribe 2067.46 ns 22.84 ns 23.74 ns 0.96
immediate_just(1,2)+last()+subscribe 1805.14 ns 24.08 ns 24.67 ns 0.98
immediate_just+take_last(1)+subscribe 2303.46 ns 71.48 ns 72.13 ns 0.99
immediate_just(1,2,3)+element_at(1)+subscribe 1332.29 ns 27.44 ns 26.52 ns 1.03

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 476.35 ns 6.48 ns 6.48 ns 1.00
current_thread scheduler create worker + schedule 651.10 ns 13.93 ns 13.97 ns 1.00
current_thread scheduler create worker + schedule + recursive schedule 1086.89 ns 104.24 ns 105.25 ns 0.99

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 1310.36 ns 24.35 ns 24.35 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 1426.78 ns 26.84 ns 26.51 ns 1.01
immediate_just+flat_map(immediate_just(v*2))+subscribe 3446.41 ns 349.41 ns 348.34 ns 1.00
immediate_just+buffer(2)+subscribe 2629.64 ns 69.27 ns 69.68 ns 0.99
immediate_just+window(2)+subscribe + subscsribe inner 3975.37 ns 1296.54 ns 1288.77 ns 1.01

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 1631.35 ns 23.14 ns 23.12 ns 1.00
immediate_just+take_while(true)+subscribe 1328.44 ns 24.37 ns 24.05 ns 1.01

Utility Operators

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

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 5086.22 ns 428.17 ns 415.02 ns 1.03
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 5454.40 ns 331.89 ns 328.26 ns 1.01
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 303.44 ns 308.19 ns 0.98
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 5260.93 ns 956.29 ns 939.31 ns 1.02
immediate_just(1) + zip(immediate_just(2)) + subscribe 3559.86 ns 551.40 ns 546.82 ns 1.01

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 36.59 ns 19.59 ns 19.46 ns 1.01
subscribe 100 observers to publish_subject 267125.00 ns 30680.00 ns 27790.24 ns 1.10
100 on_next to 100 observers to publish_subject 48595.24 ns 32590.62 ns 32575.68 ns 1.00

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1880.40 ns 103.17 ns 102.46 ns 1.01
basic sample with immediate scheduler 2272.42 ns 74.08 ns 72.28 ns 1.02

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1453.09 ns 24.99 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 2355.80 ns 280.74 ns 255.21 ns 1.10
create(on_error())+retry(1)+subscribe 1443.07 ns 202.84 ns 190.27 ns 1.07

@codecov

codecov Bot commented Oct 8, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.27%. Comparing base (b5bd748) to head (a979aa5).
Report is 1 commits behind head on v2.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2     #657      +/-   ##
==========================================
+ Coverage   98.26%   98.27%   +0.01%     
==========================================
  Files         154      154              
  Lines        7659     7670      +11     
==========================================
+ Hits         7526     7538      +12     
+ Misses        133      132       -1     

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

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2024

Copy link
Copy Markdown

@AlexInLog AlexInLog marked this pull request as ready for review October 9, 2024 05:28
@AlexInLog AlexInLog merged commit d247d64 into v2 Oct 9, 2024
@AlexInLog AlexInLog deleted the extend_coverage branch October 9, 2024 05:28
@coderabbitai coderabbitai Bot mentioned this pull request Nov 21, 2024
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