Skip to content

Improve compilation errors#639

Merged
AlexInLog merged 11 commits into
v2from
improve_compilation_erros
Sep 6, 2024
Merged

Improve compilation errors#639
AlexInLog merged 11 commits into
v2from
improve_compilation_erros

Conversation

@AlexInLog

@AlexInLog AlexInLog commented Sep 5, 2024

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Introduced the start_with operator to initialize observable sequences with a default value.
    • Enhanced flexibility of operators to accept a broader range of callable types.
  • Bug Fixes

    • Added compile-time checks to ensure type compatibility for various operators, enhancing type safety and preventing runtime errors.
  • Documentation

    • Improved clarity in test cases by standardizing result handling for assertions, making the code more readable.
  • Chores

    • Simplified pointer validation in the sendOk function for better readability and maintainability.

@coderabbitai

coderabbitai Bot commented Sep 5, 2024

Copy link
Copy Markdown
Contributor
Walkthrough

Walkthrough

The changes enhance type safety, flexibility, and readability across various components of the reactive programming library. Key modifications include the introduction of static assertions for compile-time checks, restructuring operator overloads to accept a broader range of callable types, and improvements in test case handling for clarity. The overall focus is on refining the codebase to ensure better type compatibility and maintainability.

Changes

Files Change Summary
src/examples/rpp/doxygen/map.cpp Added rpp::ops::start_with(std::string{}) operator to initialize observable with an empty string.
src/rpp/rpp/observables/connectable_observable.hpp, src/rpp/rpp/observables/observable.hpp Modified template parameters of `operator
src/rpp/rpp/observables/details/chain_strategy.hpp Added static assertion for TStrategy to enforce compatibility with observable constraints.
src/rpp/rpp/observables/fwd.hpp Introduced observables_of_same_type concept; removed and modified several existing concepts.
src/rpp/rpp/operators/flat_map.hpp, src/rpp/rpp/operators/multicast.hpp, src/rpp/rpp/operators/start_with.hpp, src/rpp/rpp/operators/subscribe.hpp Added static assertions to ensure type safety and compatibility for various operator overloads.
src/tests/rppgrpc/test_async_server.cpp Modified test cases to use intermediate variables for clarity in assertions.
src/tests/utils/rpp_trompeloil.hpp Simplified pointer validation condition in sendOk function for readability.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Observable
    participant Operator
    participant Observer

    User->>Observable: Create observable
    Observable->>Operator: Apply transformations
    Operator->>Observable: Emit initial value
    Observable->>Observer: Notify observer
    Observer->>User: Receive updates
Loading

🐰 In the meadow, I hop with glee,
A new operator, oh joy for me!
With static checks, the code is bright,
Type safety shines, a lovely sight.
Let's celebrate with a joyful cheer,
For clearer tests and no more fear! 🎉


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>.
    • 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 show all the console.log statements in this repository.
    • @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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 29e1587 and 3b16d9b.

Files selected for processing (11)
  • src/examples/rpp/doxygen/map.cpp (1 hunks)
  • src/rpp/rpp/observables/connectable_observable.hpp (1 hunks)
  • src/rpp/rpp/observables/details/chain_strategy.hpp (1 hunks)
  • src/rpp/rpp/observables/fwd.hpp (2 hunks)
  • src/rpp/rpp/observables/observable.hpp (2 hunks)
  • src/rpp/rpp/operators/flat_map.hpp (1 hunks)
  • src/rpp/rpp/operators/multicast.hpp (2 hunks)
  • src/rpp/rpp/operators/start_with.hpp (1 hunks)
  • src/rpp/rpp/operators/subscribe.hpp (4 hunks)
  • src/tests/rppgrpc/test_async_server.cpp (3 hunks)
  • src/tests/utils/rpp_trompeloil.hpp (1 hunks)
Files skipped from review due to trivial changes (2)
  • src/tests/rppgrpc/test_async_server.cpp
  • src/tests/utils/rpp_trompeloil.hpp
Additional comments not posted (14)
src/rpp/rpp/operators/flat_map.hpp (1)

27-27: Enhanced Type Safety with Static Assertions

The addition of static_assert statements in both the lvalue and rvalue overloads of the operator() function is a significant improvement. These assertions ensure that the callable Fn is correctly invocable with the expected observable type and that it returns an observable type, thus enhancing type safety and preventing potential runtime errors.

Also applies to: 36-36

src/rpp/rpp/observables/details/chain_strategy.hpp (1)

27-27: Static Assertion Enhances Type Safety in Observable Chains

The introduction of a static_assert in the chain class template is a proactive measure to ensure that the TStrategy used conforms to the operator_chain constraint. This is crucial for maintaining the integrity and safety of the observable chains, ensuring that only compatible strategies are used.

src/rpp/rpp/operators/multicast.hpp (2)

27-27: Static Assertion for Type Compatibility Approved

The static assertion correctly ensures that the observable and subject types match, enhancing type safety and preventing runtime errors.


38-38: Static Assertion for Subject Construction Approved

The static assertion ensures that the subject can be constructed with the observable type, which is crucial for maintaining type safety across the library.

src/rpp/rpp/observables/fwd.hpp (5)

82-83: Approval of New Concept observables_of_same_type

The new concept consolidates type checking for multiple observables, enhancing clarity and potentially improving performance by reducing complexity.


86-86: Simplified operator_subscribe Concept Approved

The removal of the dependency on operator_base simplifies the concept, making it more direct and potentially more efficient.


93-93: Simplified operator_lift Concept Approved

The concept has been streamlined effectively, removing unnecessary complexity and enhancing clarity.


100-100: Simplified operator_lift_with_disposable_strategy Concept Approved

The concept's simplification aligns with the PR's objectives, enhancing type safety and maintainability.


107-114: Restructured operator_chain Concept Approved

The concept has been restructured to ensure more explicit and precise type checks, aligning with the PR's focus on enhancing type safety.

src/rpp/rpp/observables/connectable_observable.hpp (2)

133-134: Enhanced Flexibility of operator| for Const Lvalue References Approved

The modification to use std::invocable increases the flexibility of the operator, allowing it to accept a broader range of callable types.


139-140: Enhanced Flexibility of operator| for Rvalue References Approved

The modification to use std::invocable for rvalue references is consistent with the changes for const lvalue references, enhancing the operator's usability and compatibility.

src/rpp/rpp/operators/start_with.hpp (1)

28-28: Approved: Enhanced type safety with static assertion.

The addition of the static assertion in the operator() function is a significant improvement. It ensures that the observable types are consistent, enhancing compile-time type safety and preventing potential runtime errors due to type mismatches.

src/rpp/rpp/operators/subscribe.hpp (1)

65-65: Approved: Enhanced type safety with static assertions across various methods.

The addition of static assertions in the operator() methods across various template specializations significantly enhances type safety. These assertions ensure that the observer and observable types are compatible, which is crucial for preventing runtime errors and improving the robustness of the code.

Also applies to: 72-72, 121-121, 129-129, 155-155, 162-162, 188-188, 196-196

src/rpp/rpp/observables/observable.hpp (1)

313-316: Approved: Enhanced flexibility and type handling in operator| overloads.

The restructuring of the operator| method to accept a broader range of callable types and the simplification of the operator invocation process are significant improvements. The use of std::invocable constraints and the direct invocation of operators enhance the flexibility and usability of the method. Additionally, the determination of the result type using operator_traits ensures enhanced type safety and correct inference of the return type.

Also applies to: 319-322, 325-327, 332-334, 339-344, 347-352

Comment thread src/examples/rpp/doxygen/map.cpp Outdated
@AlexInLog AlexInLog changed the title Improve compilation erros Improve compilation erroкs Sep 6, 2024
@AlexInLog AlexInLog changed the title Improve compilation erroкs Improve compilation errors Sep 6, 2024

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3b16d9b and 1a264c4.

Files selected for processing (2)
  • src/rpp/rpp/observables/observable.hpp (2 hunks)
  • src/rpp/rpp/operators/start_with.hpp (2 hunks)
Additional comments not posted (3)
src/rpp/rpp/operators/start_with.hpp (2)

28-28: Approved: Enhanced Type Safety with Static Assertion

The addition of the static assertion in start_with_t enhances type safety by ensuring that all observables passed to this operator are of the same type. This is a crucial improvement for preventing type mismatches and potential runtime errors.


56-56: Approved: Static Assertion for Observable Type Compatibility

The static assertion in start_with_values_t ensures that the observable's type is compatible with the type stored in the container. This check is essential for maintaining type safety and preventing errors due to incompatible types being processed together.

src/rpp/rpp/observables/observable.hpp (1)

327-353: Approved: Enhanced Flexibility and Type Safety in Operator Overloads

The modifications to the operator| method significantly enhance its flexibility and type safety. The method now supports a broader range of callable types and uses operator_traits to accurately determine the result type. This change simplifies the operator chaining process and ensures that the observable's behavior remains consistent and predictable.

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1a264c4 and 7b1174e.

Files selected for processing (1)
  • src/rpp/rpp/observables/connectable_observable.hpp (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/rpp/rpp/observables/connectable_observable.hpp

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7b1174e and 0526a59.

Files selected for processing (2)
  • src/rpp/rpp/observables/connectable_observable.hpp (1 hunks)
  • src/rpp/rpp/observables/observable.hpp (2 hunks)
Additional comments not posted (5)
src/rpp/rpp/observables/connectable_observable.hpp (2)

133-142: Approved: Enhanced flexibility with std::invocable and proper type checks.

The changes to the lvalue overload of operator| correctly use std::invocable to allow a broader range of callable types. The static assertion ensures that the result is still an observable, maintaining type safety.


145-154: Approved: Consistent handling of rvalue references with std::invocable.

The rvalue overload of operator| correctly uses std::invocable and includes appropriate static assertions to ensure the result is an observable. This maintains consistency with the lvalue overload and ensures type safety.

src/rpp/rpp/observables/observable.hpp (3)

313-317: Approved: Simplified operator handling for Subscribe types.

The changes to the operator| method for handling Subscribe types correctly use a requires clause to constrain the template parameter. The direct invocation of the operator with std::forward simplifies the logic and maintains efficiency.


320-332: Approved: Enhanced type safety and flexibility with operator_traits.

The changes to the operator| method for handling Op types not derived from subscribe_t correctly use operator_traits to determine the result type. This ensures type safety and enhances flexibility in handling different operator types.


335-347: Approved: Consistent handling of rvalue references with operator_traits.

The rvalue overload of operator| correctly uses operator_traits and includes appropriate static assertions to ensure the result is an observable. This maintains consistency with the lvalue overload and ensures type safety.

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0526a59 and 85c5c02.

Files selected for processing (1)
  • src/rpp/rpp/observables/connectable_observable.hpp (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/rpp/rpp/observables/connectable_observable.hpp

@github-actions

github-actions Bot commented Sep 6, 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 298.13 ns 2.16 ns 2.16 ns 1.00
Subscribe empty callbacks to empty observable via pipe operator 301.58 ns 2.16 ns 2.16 ns 1.00

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 684.72 ns 0.31 ns 0.31 ns 1.00
from array of 1 - create + subscribe + current_thread 1046.03 ns 3.42 ns 3.42 ns 1.00
concat_as_source of just(1 immediate) create + subscribe 2265.36 ns 103.10 ns 103.31 ns 1.00
defer from array of 1 - defer + create + subscribe + immediate 745.63 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2122.89 ns 59.23 ns 59.33 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3021.55 ns 32.46 ns 32.42 ns 1.00
from array of 1 - create + as_blocking + subscribe + new_thread 30800.03 ns 31093.14 ns 30802.66 ns 1.01
from array of 1000 - create + as_blocking + subscribe + new_thread 42522.04 ns 54715.80 ns 55910.68 ns 0.98
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3516.51 ns 120.57 ns 122.96 ns 0.98

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1081.21 ns 0.31 ns 0.31 ns 1.00
immediate_just+filter(true)+subscribe 822.84 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 978.82 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 932.79 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+first()+subscribe 1235.36 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+last()+subscribe 908.03 ns 0.31 ns 0.31 ns 1.00
immediate_just+take_last(1)+subscribe 1108.39 ns 18.53 ns 18.20 ns 1.02
immediate_just(1,2,3)+element_at(1)+subscribe 831.10 ns 0.31 ns 0.31 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 271.47 ns 2.16 ns 2.16 ns 1.00
current_thread scheduler create worker + schedule 362.53 ns 5.86 ns 5.87 ns 1.00
current_thread scheduler create worker + schedule + recursive schedule 811.70 ns 56.55 ns 55.89 ns 1.01

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 829.29 ns 0.31 ns 0.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 925.72 ns 0.31 ns 0.31 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 2328.97 ns 173.15 ns 172.66 ns 1.00
immediate_just+buffer(2)+subscribe 1531.60 ns 14.20 ns 13.59 ns 1.04
immediate_just+window(2)+subscribe + subscsribe inner 2392.73 ns 1164.62 ns 1144.08 ns 1.02

Conditional Operators

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

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 1962.93 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 3368.52 ns 182.53 ns 175.73 ns 1.04
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3672.78 ns 169.16 ns 173.18 ns 0.98
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 130.99 ns 142.37 ns 0.92
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3549.53 ns 1075.03 ns 1001.53 ns 1.07
immediate_just(1) + zip(immediate_just(2)) + subscribe 2129.43 ns 241.60 ns 212.91 ns 1.13

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 34.57 ns 14.55 ns 14.60 ns 1.00
subscribe 100 observers to publish_subject 198976.00 ns 15577.61 ns 15856.98 ns 0.98
100 on_next to 100 observers to publish_subject 27011.18 ns 20181.42 ns 22263.67 ns 0.91

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1383.02 ns 12.65 ns 13.28 ns 0.95
basic sample with immediate scheduler 1447.38 ns 5.26 ns 5.24 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 909.85 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 2019.06 ns 1050.61 ns 994.53 ns 1.06
create(on_error())+retry(1)+subscribe 619.21 ns 101.91 ns 107.62 ns 0.95

ci-macos

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 971.34 ns 3.90 ns 4.65 ns 0.84
Subscribe empty callbacks to empty observable via pipe operator 970.84 ns 3.90 ns 4.64 ns 0.84

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1935.27 ns 0.23 ns 0.28 ns 0.83
from array of 1 - create + subscribe + current_thread 2430.08 ns 35.08 ns 41.44 ns 0.85
concat_as_source of just(1 immediate) create + subscribe 5403.65 ns 334.26 ns 396.63 ns 0.84
defer from array of 1 - defer + create + subscribe + immediate 1957.74 ns 0.23 ns 0.28 ns 0.83
interval - interval + take(3) + subscribe + immediate 4883.61 ns 114.70 ns 135.59 ns 0.85
interval - interval + take(3) + subscribe + current_thread 5994.45 ns 98.74 ns 117.61 ns 0.84
from array of 1 - create + as_blocking + subscribe + new_thread 82305.60 ns 94291.92 ns 125249.78 ns 0.75
from array of 1000 - create + as_blocking + subscribe + new_thread 87812.85 ns 93768.00 ns 121430.78 ns 0.77
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 8173.10 ns 375.47 ns 449.65 ns 0.84

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 2770.58 ns 0.23 ns 0.28 ns 0.81
immediate_just+filter(true)+subscribe 2054.87 ns 0.23 ns 0.28 ns 0.81
immediate_just(1,2)+skip(1)+subscribe 2683.95 ns 0.23 ns 0.28 ns 0.81
immediate_just(1,1,2)+distinct_until_changed()+subscribe 2021.37 ns 0.46 ns 0.56 ns 0.82
immediate_just(1,2)+first()+subscribe 3100.38 ns 0.23 ns 0.28 ns 0.81
immediate_just(1,2)+last()+subscribe 2330.02 ns 0.23 ns 0.28 ns 0.82
immediate_just+take_last(1)+subscribe 2972.32 ns 0.23 ns 0.28 ns 0.81
immediate_just(1,2,3)+element_at(1)+subscribe 2072.81 ns 0.23 ns 0.28 ns 0.82

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 845.52 ns 4.14 ns 4.97 ns 0.83
current_thread scheduler create worker + schedule 1341.89 ns 39.56 ns 46.61 ns 0.85
current_thread scheduler create worker + schedule + recursive schedule 2027.28 ns 237.01 ns 311.69 ns 0.76

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 2098.08 ns 4.43 ns 5.30 ns 0.84
immediate_just+scan(10, std::plus)+subscribe 2232.34 ns 0.45 ns 0.56 ns 0.80
immediate_just+flat_map(immediate_just(v*2))+subscribe 5051.37 ns 384.68 ns 484.99 ns 0.79
immediate_just+buffer(2)+subscribe 2379.75 ns 62.15 ns 76.59 ns 0.81
immediate_just+window(2)+subscribe + subscsribe inner 5156.98 ns 2284.18 ns 2884.70 ns 0.79

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 2089.09 ns - - 0.00
immediate_just+take_while(true)+subscribe 2093.93 ns 0.23 ns 0.28 ns 0.83

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 4715.57 ns 4.78 ns 5.85 ns 0.82

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 7598.77 ns 451.05 ns 528.10 ns 0.85
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 8446.15 ns 450.14 ns 526.52 ns 0.85
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 461.74 ns 625.95 ns 0.74
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 7934.56 ns 1903.13 ns 2280.57 ns 0.83
immediate_just(1) + zip(immediate_just(2)) + subscribe 5199.65 ns 920.70 ns 1007.50 ns 0.91

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 76.99 ns 46.75 ns 58.26 ns 0.80
subscribe 100 observers to publish_subject 343216.33 ns 40896.75 ns 48996.65 ns 0.83
100 on_next to 100 observers to publish_subject 49403.90 ns 16607.68 ns 24652.73 ns 0.67

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 2744.06 ns 69.73 ns 83.43 ns 0.84
basic sample with immediate scheduler 2753.45 ns 18.62 ns 23.04 ns 0.81

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 2322.75 ns 0.23 ns 0.28 ns 0.84

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 6226.34 ns 3940.23 ns 4934.23 ns 0.80
create(on_error())+retry(1)+subscribe 1729.18 ns 274.11 ns 340.74 ns 0.80

ci-ubuntu-clang

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 272.59 ns 1.57 ns 0.88 ns 1.78
Subscribe empty callbacks to empty observable via pipe operator 267.19 ns 1.56 ns 0.88 ns 1.78

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 564.14 ns 0.31 ns 0.31 ns 0.99
from array of 1 - create + subscribe + current_thread 785.18 ns 4.32 ns 4.32 ns 1.00
concat_as_source of just(1 immediate) create + subscribe 2567.89 ns 133.27 ns 131.47 ns 1.01
defer from array of 1 - defer + create + subscribe + immediate 799.06 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2400.95 ns 58.31 ns 58.31 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3344.97 ns 30.88 ns 30.88 ns 1.00
from array of 1 - create + as_blocking + subscribe + new_thread 30230.91 ns 31055.57 ns 31267.03 ns 0.99
from array of 1000 - create + as_blocking + subscribe + new_thread 40200.48 ns 39809.53 ns 35697.03 ns 1.12
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3985.14 ns 150.61 ns 149.62 ns 1.01

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1186.14 ns 0.31 ns 0.31 ns 1.00
immediate_just+filter(true)+subscribe 849.47 ns 0.31 ns 0.31 ns 1.01
immediate_just(1,2)+skip(1)+subscribe 1084.57 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 871.53 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+first()+subscribe 1383.49 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+last()+subscribe 1027.76 ns 0.31 ns 0.31 ns 1.00
immediate_just+take_last(1)+subscribe 1181.60 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2,3)+element_at(1)+subscribe 856.82 ns 0.31 ns 0.31 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 279.61 ns 1.56 ns 0.88 ns 1.78
current_thread scheduler create worker + schedule 385.71 ns 4.94 ns 4.94 ns 1.00
current_thread scheduler create worker + schedule + recursive schedule 892.74 ns 57.88 ns 56.71 ns 1.02

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 846.49 ns 0.31 ns 0.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 972.03 ns 0.31 ns 0.31 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 2235.58 ns 140.09 ns 138.61 ns 1.01
immediate_just+buffer(2)+subscribe 1548.58 ns 13.89 ns 13.59 ns 1.02
immediate_just+window(2)+subscribe + subscsribe inner 2519.46 ns 922.06 ns 935.39 ns 0.99

Conditional Operators

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

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2017.26 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 3302.88 ns 161.49 ns 160.50 ns 1.01
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3716.31 ns 148.97 ns 146.41 ns 1.02
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 143.70 ns 143.73 ns 1.00
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3387.74 ns 998.65 ns 845.12 ns 1.18
immediate_just(1) + zip(immediate_just(2)) + subscribe 2196.21 ns 200.71 ns 202.24 ns 0.99

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 54.04 ns 17.65 ns 17.45 ns 1.01
subscribe 100 observers to publish_subject 216218.00 ns 16109.57 ns 15980.93 ns 1.01
100 on_next to 100 observers to publish_subject 42757.07 ns 20428.77 ns 20452.25 ns 1.00

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1307.90 ns 11.73 ns 11.73 ns 1.00
basic sample with immediate scheduler 1272.96 ns 6.17 ns 6.17 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1008.04 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 2198.15 ns 1244.28 ns 1238.39 ns 1.00
create(on_error())+retry(1)+subscribe 670.33 ns 138.33 ns 139.34 ns 0.99

ci-windows

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 561.30 ns 4.02 ns 4.93 ns 0.81
Subscribe empty callbacks to empty observable via pipe operator 581.31 ns 4.02 ns 4.57 ns 0.88

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1158.96 ns 9.69 ns 9.71 ns 1.00
from array of 1 - create + subscribe + current_thread 1424.35 ns 17.91 ns 17.60 ns 1.02
concat_as_source of just(1 immediate) create + subscribe 3747.65 ns 175.52 ns 178.83 ns 0.98
defer from array of 1 - defer + create + subscribe + immediate 1183.74 ns 9.40 ns 9.41 ns 1.00
interval - interval + take(3) + subscribe + immediate 3661.46 ns 145.56 ns 144.01 ns 1.01
interval - interval + take(3) + subscribe + current_thread 3407.72 ns 63.59 ns 65.45 ns 0.97
from array of 1 - create + as_blocking + subscribe + new_thread 127212.50 ns 126277.78 ns 112540.00 ns 1.12
from array of 1000 - create + as_blocking + subscribe + new_thread 135000.00 ns 136675.00 ns 127388.89 ns 1.07
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 5363.59 ns 208.27 ns 223.40 ns 0.93

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1818.36 ns 25.30 ns 24.99 ns 1.01
immediate_just+filter(true)+subscribe 1308.77 ns 24.37 ns 24.06 ns 1.01
immediate_just(1,2)+skip(1)+subscribe 1982.63 ns 24.07 ns 23.45 ns 1.03
immediate_just(1,1,2)+distinct_until_changed()+subscribe 1351.41 ns 28.99 ns 26.25 ns 1.10
immediate_just(1,2)+first()+subscribe 2079.10 ns 22.82 ns 23.76 ns 0.96
immediate_just(1,2)+last()+subscribe 1775.13 ns 24.07 ns 24.69 ns 0.97
immediate_just+take_last(1)+subscribe 1996.67 ns 70.85 ns 70.58 ns 1.00
immediate_just(1,2,3)+element_at(1)+subscribe 1305.84 ns 27.47 ns 26.56 ns 1.03

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 479.65 ns 6.79 ns 6.79 ns 1.00
current_thread scheduler create worker + schedule 646.61 ns 14.34 ns 14.03 ns 1.02
current_thread scheduler create worker + schedule + recursive schedule 1103.09 ns 103.02 ns 104.27 ns 0.99

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 1316.56 ns 24.37 ns 24.37 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 1407.38 ns 26.82 ns 26.51 ns 1.01
immediate_just+flat_map(immediate_just(v*2))+subscribe 3456.59 ns 210.92 ns 210.98 ns 1.00
immediate_just+buffer(2)+subscribe 2624.30 ns 69.53 ns 69.71 ns 1.00
immediate_just+window(2)+subscribe + subscsribe inner 3991.64 ns 1287.91 ns 1281.32 ns 1.01

Conditional Operators

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

Utility Operators

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

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 5136.16 ns 225.89 ns 226.57 ns 1.00
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 5418.52 ns 225.53 ns 223.76 ns 1.01
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 200.28 ns 197.28 ns 1.02
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 5380.10 ns 942.66 ns 932.77 ns 1.01
immediate_just(1) + zip(immediate_just(2)) + subscribe 3566.67 ns 521.52 ns 514.47 ns 1.01

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 36.79 ns 20.67 ns 20.98 ns 0.99
subscribe 100 observers to publish_subject 265200.00 ns 27766.67 ns 30433.33 ns 0.91
100 on_next to 100 observers to publish_subject 55105.26 ns 38848.15 ns 38882.76 ns 1.00

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1875.62 ns 100.93 ns 101.91 ns 0.99
basic sample with immediate scheduler 1867.34 ns 73.99 ns 84.51 ns 0.88

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1464.16 ns 24.99 ns 24.68 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 2199.81 ns 355.60 ns 348.89 ns 1.02
create(on_error())+retry(1)+subscribe 1556.44 ns 140.29 ns 139.68 ns 1.00

@codecov

codecov Bot commented Sep 6, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.69%. Comparing base (29e1587) to head (85c5c02).
Report is 1 commits behind head on v2.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2     #639      +/-   ##
==========================================
+ Coverage   95.66%   95.69%   +0.03%     
==========================================
  Files          98       97       -1     
  Lines        1867     1882      +15     
==========================================
+ Hits         1786     1801      +15     
  Misses         81       81              

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

@sonarqubecloud

sonarqubecloud Bot commented Sep 6, 2024

Copy link
Copy Markdown

@AlexInLog AlexInLog marked this pull request as ready for review September 6, 2024 18:25
@AlexInLog AlexInLog merged commit 8ddb555 into v2 Sep 6, 2024
@AlexInLog AlexInLog deleted the improve_compilation_erros branch September 6, 2024 18:26
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