Skip to content

Commit

Permalink
Do not use exceptions in the ASIOOutputReady() code path.
Browse files Browse the repository at this point in the history
Timing data indicates this is causing deadlines to be missed due to
poor exception throwing performance.
  • Loading branch information
dechamps committed Jan 20, 2019
1 parent 4ceb554 commit 6d64747
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/asio401/ASIO401/casio401.cpp
Expand Up @@ -133,9 +133,11 @@ namespace asio401 {
}

ASIOError outputReady() throw() final {
return Enter("outputReady()", [] {
throw ASIOException(ASE_NotPresent, "outputReady() is not supported");
});
// We do not use Enter() and throw here, because this can be called in a real-time code path, and the cost
// of throwing exceptions is high and highly variable. When Enter() + throw was used here, this method could
// take as much as ~10 ms to run in the long tail.
Log() << "outputReady() called, returning ASE_NotPresent";
return ASE_NotPresent;
}

private:
Expand Down

0 comments on commit 6d64747

Please sign in to comment.