Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,11 @@ jobs:
# Prepare Python virtual environment containing Conan.
# (See comments in Flow-IPC workflow counterpart's analogous step. We use same techniques.)
pip install virtualenv
virtualenv ${{ github.workspace }}/conan_virtual_env
source ${{ github.workspace }}/conan_virtual_env/bin/activate
virtualenv ${{ runner.temp }}/conan_virtual_env
source ${{ runner.temp }}/conan_virtual_env/bin/activate
pip install pip-tools
pip-compile ${{ github.workspace }}/.github/workflows/requirements.in
pip-sync ${{ github.workspace }}/.github/workflows/requirements.txt
pip-compile -o ${{ runner.temp }}/requirements.txt ${{ github.workspace }}/.github/workflows/requirements.in
pip-sync ${{ runner.temp }}/requirements.txt

- name: Add custom settings for Conan packages
if: |
Expand All @@ -498,7 +498,7 @@ jobs:
# Conan keeps custom settings in settings_user.yml, an overlay merged onto the built-in settings.yml;
# so simply write the overlay dict from our matrix higher-up.
# (`conan config home` auto-creates the home dir if needed.)
source ${{ github.workspace }}/conan_virtual_env/bin/activate
source ${{ runner.temp }}/conan_virtual_env/bin/activate
CONAN_USER_SETTINGS_PATH=$(conan config home)/settings_user.yml
python -c "
import yaml
Expand Down Expand Up @@ -571,7 +571,7 @@ jobs:
if: env.cell-selected == 'true'
run: |
# Install Flow dependencies with Conan using the profile.
source ${{ github.workspace }}/conan_virtual_env/bin/activate
source ${{ runner.temp }}/conan_virtual_env/bin/activate
${{ env.setup-run-env }}
# Flag-snapshot guard. For explanation see comments in Flow-IPC workflow counterpart -- both in its
# analogous step and atop its conan-cache-restore step. We use same techniques.
Expand Down Expand Up @@ -627,7 +627,7 @@ jobs:
if: env.cell-selected == 'true'
run: |
# Build libraries and demos/tests with Conan.
source ${{ github.workspace }}/conan_virtual_env/bin/activate
source ${{ runner.temp }}/conan_virtual_env/bin/activate
${{ env.setup-run-env }}
# Prefixing with $BUILT_CMD_PREFIX here too, in case the build ends up running some binary built with our
# build-settings. (In Flow-IPC workflow counterpart it definitely does -- the capnp compiler binary.)
Expand Down Expand Up @@ -846,11 +846,11 @@ jobs:
# Prepare Python virtual environment containing Conan.
# (See comment in the build-and-test job's analogous step.)
pip install virtualenv
virtualenv ${{ github.workspace }}/conan_virtual_env
source ${{ github.workspace }}/conan_virtual_env/bin/activate
virtualenv ${{ runner.temp }}/conan_virtual_env
source ${{ runner.temp }}/conan_virtual_env/bin/activate
pip install pip-tools
pip-compile ${{ github.workspace }}/.github/workflows/requirements.in
pip-sync ${{ github.workspace }}/.github/workflows/requirements.txt
pip-compile -o ${{ runner.temp }}/requirements.txt ${{ github.workspace }}/.github/workflows/requirements.in
pip-sync ${{ runner.temp }}/requirements.txt

# See comments in Flow-IPC workflow counterpart. We use same techniques.
- name: (On release creation only) Signal Pages about release (web site should update)
Expand Down Expand Up @@ -903,7 +903,7 @@ jobs:
- name: Install Flow dependencies (like Doxygen) with Conan using the profile
run: |
# Install Flow dependencies (like Doxygen) with Conan using the profile.
source ${{ github.workspace }}/conan_virtual_env/bin/activate
source ${{ runner.temp }}/conan_virtual_env/bin/activate
conan install . -pr:a ./conan_profile --build=missing
# (See comment in the build-and-test job's analogous step.)
conan cache clean '*' --source --build
Expand All @@ -918,7 +918,7 @@ jobs:
- name: Generate code documentation using Conan and Doxygen
run: |
# Generate code documentation using Conan and Doxygen.
source ${{ github.workspace }}/conan_virtual_env/bin/activate
source ${{ runner.temp }}/conan_virtual_env/bin/activate
# (`conan build` recomputes the dep-graph and hence needs the profile, just like `conan install`.)
conan build . -pr:a ./conan_profile

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Comment and/or doc changes.

## API notes
* New APIs:
* New/improved APIs:
* `flow::log::Config::init_component_to_union_idx_mapping()` new optional arg `component_payload_type_info_ptr_is_uniq = false`; set to `true` for potentially significant performance gains within Flow and flow.log log call sites in your application.
* Two optional preprocessor defines to further tweak perf-related internal behavior: `FLOW_LOG_CONFIG_COMPONENT_PAYLOAD_TYPE_DICT_BY_PTR`, `FLOW_LOG_CONFIG_COMPONENT_PAYLOAD_TYPE_DICT_BY_VAL`.
* Breaking changes:
Expand Down
8 changes: 4 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Installation

An exported Flow consists of C++ header files installed under "flow/..." in the include-root; and a
An exported Flow consists of C++ header files installed under `flow/...` in the include-root; and a
library such as `libflow.a`. Certain items are also exported for people who use CMake to build their own
projects; we make it particularly easy to use Flow in that case (`find_package(Flow)`). Lastly documentation
is included in the source tree for local perusal; and can be optionally re-generated from local source (more
Expand Down Expand Up @@ -40,9 +40,9 @@ To build Flow:
but the basics are as follows. CMake is very flexible and powerful; we've tried not to mess with that principle
in our build script(s).
1. Choose a tool. `ccmake` will allow you to interactively configure aspects of the build system, including
showing docs for various knobs our CMakeLists.txt (and friends) have made availale. `cmake` will do so without
asking questions; you'll need to provide all required inputs on the command line. Let's assume `cmake` below,
but you can use whichever makes sense for you.
showing docs for various knobs our `CMakeLists.txt` (and friends) have made available. `cmake` will do so
without asking questions; you'll need to provide all required inputs on the command line. Let's assume `cmake`
below, but you can use whichever makes sense for you.
2. Choose a working *build directory*, somewhere outside the present `flow` distribution. Let's call this
`$BUILD`: please `mkdir -p $BUILD`. Below we'll refer to the directory containing the present `README.md` file
as `$SRC`.
Expand Down
4 changes: 2 additions & 2 deletions src/flow/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
* While an important (achieved) goal is to keep the documentation of the library (internal and external, as noted)
* self-contained -- within the source code or auto-generated by taking that source code as input -- nevertheless some
* satellite documentation is likely to exist; for example to cover such things as the logistical state of the project,
* its test harness, perhaps the license, etc. Look outside the root src/flow directory.
* its test harness, perhaps the license, etc. Look outside the root `src/flow` directory.
*
* @todo As of this writing the *exact* nature of where the project will permanently reside (and who will maintain it
* vs. use it) is in flux. Therefore for now I have removed the section covering certain topics and replaced it with
Expand Down Expand Up @@ -262,7 +262,7 @@
* produce Doxygen output (2 web pages, as of this writing) by running the code through Doxygen.
*
* @see More on the technicalities of how we run Doxygen, and the philosophy behind all of that, can be found
* in a `doc/` or similar directory outside src/flow. It's rare something pertinent to the source code
* in a `doc/` or similar directory outside `src/flow`. It's rare something pertinent to the source code
* is not IN the source code (i.e., right here somewhere), but the README explains why that rare choice is
* made (among many more practical/interesting things). This is worth reading if you'll be contributing to the
* code.
Expand Down
4 changes: 2 additions & 2 deletions src/flow/net_flow/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ namespace flow::net_flow
* critical sections around the calls to `m_low_lvl_sock::async_receive()` and `m_low_lvl_sock::async_send()`,
* but as noted before this seems extremely unlikely to have any real cost due to the shortess of critical
* sections in both threads. If this is APPROACH 4, then I'd say just time how much absolute delay is
* introduced by a `post(W2')` or `post(W2'')` of the async send call compared to directly making such a
* introduced by a `post()` onto W2' or W2'' of the async send call compared to directly making such a
* call on thread W, as is done today. I suspect it's small, in which case the action is go for
* APPROACH 4... finally.
*
Expand Down Expand Up @@ -2630,7 +2630,7 @@ class Node :
* - `sock->m_mutex` is locked and after entering `sock->[sync_]send()`;
* - no changes to `*sock` have been made since `m_mutex` was locked;
* - `sock->state() == State::S_OPEN` (so `sock` is in #m_socks);
* - `snd_buf_feed_func is as described below.
* - `snd_buf_feed_func` is as described below.
*
* This method completes the functionality of `sock->send()`.
*
Expand Down
2 changes: 1 addition & 1 deletion src/flow/net_flow/peer_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3811,7 +3811,7 @@ void Node::snd_flying_pkts_push_one(Peer_socket::Ptr sock,
* snd_flying_pkts_by_when, the actual value of sent_pkt->m_sent_when.back() -- the absolute "when" -- isn't ready.
* It will only be finalized once we actually send off the packet (after pacing, if any), in mark_data_packet_sent().
* Nevertheless, we know the packet will be sent sometime fairly soon; and in fact AFTER all the packets
* following it it in snd_flying_pkts_by_when's iterator ordering and in fact BEFORE any packets that
* following it in snd_flying_pkts_by_when's iterator ordering and in fact BEFORE any packets that
* would be subsequently ahead of it in snd_flying_pkts_by_when's iterator ordering. That is, we can
* place it there now, despite not knowing the _absolute_ time when it be sent, because we are confident about
* its _relative_ order of when it will be sent vs. all the other packets in that structure, past or future. */
Expand Down
2 changes: 1 addition & 1 deletion src/flow/perf/perf_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ auto timed_function_nvr(Clock_type clock_type, Accumulator* accumulator, Func&&
* @note This is suitable for using the Flow-recommended boost.asio wrapper/helper API, flow::async.
* @warning Using `timed_function(handler)` would "work" too, in that it would compile and at a first glance appear to
* work fine. The problem: If `handler` is bound to an executor -- most commonly a boost.asio strand
* (util::Strand) -- then using timed_function() would "unbind it." So it it was bound to `Strand S`, meant
* (util::Strand) -- then using timed_function() would "unbind it." So it was bound to `Strand S`, meant
* to make certain `handler()` never executed concurrently with other handlers bound to `S`, then that
* constraint would (silently!) no longer be observed -- leading to terrible intermittent concurrency bugs.
* @note boost.asio handlers always return `void` (meaning anything else they might return is ignored). Hence there is
Expand Down
2 changes: 1 addition & 1 deletion src/flow/util/basic_blob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ struct Clear_on_alloc {};
* allocator's resources -- the source pool or whatever it is -- must stay alive until the deallocation does
* occur according to the simple above-documented rules of when that must happen.) The rationale is that
* Basic_blob is biased toward simple, predictable behavior w/r/t deallocs and allocs occurring, even in the
* fact of exotic get_allocator() changes.
* face of exotic get_allocator() changes.
*
* ### Logging ###
* When and if `*this` logs, it is with log::Sev::S_TRACE severity or more verbose.
Expand Down
2 changes: 1 addition & 1 deletion src/flow/util/sched_task_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ using Scheduled_task = Function<void (bool short_fire)>;
* - A rule of thumb in answering the question, 'Is this facility fine to just call repeatedly, or should we reuse
* a `Timer` for performance?': It *might* not be fine if and only if timer firings and/or cancellations occur
* many times a second in a performance-sensitive environment. E.g., if it's something fired and/or canceled
* every second repeatedly, it's fine; it it's packet pacing that must sensitively fire near the resolution limit
* every second repeatedly, it's fine; if it's packet pacing that must sensitively fire near the resolution limit
* of the native #Timer facility, it *might* not be fine, and it's safer to use #Timer repeatedly.
* - A #Timer can be re-scheduled to fire at an arbitrary different time than originally set. We provide no such
* facility. (We could provide such an API at the cost of API and implementation complexity; it's a judgment call,
Expand Down
16 changes: 8 additions & 8 deletions src/flow/util/stat/histo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace flow::util::stat
*
* All reads and writes are done using `std::atomic` with `memory_order_relaxed`, meaning one can (at least
* given Linux x86-64) expect similar performance to regular loads/stores sans `atomic<>`. (The `++` op, for
* x86-64 -- `x.fetch_add(1)` -- does take a few more cycles on an `atomic` than a naked `++` would; it it not
* x86-64 -- `x.fetch_add(1)` -- does take a few more cycles on an `atomic` than a naked `++` would; it is not
* the identical processor instruction. However the cycle cost difference is in the low-single-digit-ns range
* when uncontended: not identical but close. That pertains to record_value(). Cf.: loads (count_for_bucket())
* are fully identical.)
Expand All @@ -68,7 +68,7 @@ namespace flow::util::stat
* Each bucket has width that is at least 1 (no null buckets). Therefore each bucket can be represented as
* a combination of the following:
* - Min-value: To land in the bucket, the outcome must be *at least* min-value.
* - Width. This determines max-value: Min-vale plus width minus 1. To land in the bucket, the outcome must be
* - Width. This determines max-value: Min-value plus width minus 1. To land in the bucket, the outcome must be
* *at most* max-value. The next bucket, if any, begins at exactly max-value plus 1.
*
* This just leaves the aforementioned allowance of any input. Dice are not a great example for this, but just
Expand Down Expand Up @@ -159,9 +159,9 @@ namespace flow::util::stat
*
* One mechanical subtlety is that we use stat::load(), stat::store(), and stat::fetch_add() as our atomic ops.
* These are respectively simply:
* - load(x) is `x.load(memory_order_relaxed)`.
* - store(&x, y) is `x.store(y, memory_order_relaxed).
* - fetch_add(&x, y) is `x.fetch_add(y, memory_order_relaxed)`.
* - `load(x)` is `x.load(memory_order_relaxed)`.
* - `store(&x, y)` is `x.store(y, memory_order_relaxed)`.
* - `fetch_add(&x, y)` is `x.fetch_add(y, memory_order_relaxed)`.
*
* We promised `memory_order_relaxed` perf and semantics; and those ops are available in flow::util::stat.
*/
Expand Down Expand Up @@ -440,19 +440,19 @@ class Histogram_counter
* bucket's count to increment, given an outcome belonging to one of said buckets. That is the central
* and only potentially time-consuming of the fast-path ops in a `*this`. The following cases are to be
* considered in order for a good combo of performance (top priority) and simplicity.
* -# **If `size() == 2`**
* -# If `size() == 2`:
* Only `m_bucket_val0s[1]` matters: Outcomes less-than this min-value are in bucket 0;
* else in bucket 1. Various corner cases can be ignored if we handle this particular degenerate case
* separately.
* - Time complexity: constant.
* -# **If #m_linear_bucket_sz_or_0 is in effect (`!= 0`)**
* -# If #m_linear_bucket_sz_or_0 is in effect (`!= 0`):
* This means all 1+ buckets strictly-between 1st and last are of the same width (vacuously so if `size() == 3`);
* namely `m_linear_bucket_sz_or_0`. Therefore an optimized algorithm for idx_of_outcome() is in effect; no search
* through buckets is required. Instead: if below `F = m_bucket_val0s[1]` => index 0; otherwise subtract `F`,
* divide by `m_linear_bucket_sz_or_0`, and add 1. The result, clipped against the ceiling `size() - 1`, is
* the index sought.
* - Time complexity: constant.
* -# **General case**
* -# General case:
* No particular optimization applies. Perform a binary-search through #m_bucket_val0s, clip against
* the range [`0`, `size()`), and voila.
* - Time complexity: logarithmic in size().
Expand Down
Loading
Loading