Skip to content

Commit

Permalink
fixup! fixup! fixup! SILKit-1607: Fix performance
Browse files Browse the repository at this point in the history
  • Loading branch information
VLukasBecker committed Nov 8, 2024
1 parent 0c735e4 commit 024a760
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion SilKit/source/services/logging/Test_Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ TEST(Test_Logger, LogOnceFlag_check_setter)
EXPECT_EQ(once.WasCalled(), true);
}


TEST(Test_Logger, send_loggermessage_from_logger)
{
std::string loggerName{"ParticipantAndLogger"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ auto SystemStateTracker::UpdateParticipantStatus(const ParticipantStatus& newPar
lm.FormatKeyValue(Log::Keys::newParticipantState, "{}", newParticipantState);
lm.Dispatch();
}

// Check if transition from the old to the new participant state is valid
if (!ValidateParticipantStateUpdate(oldParticipantState, newParticipantState))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "silkit/services/orchestration/OrchestrationDatatypes.hpp"
#include "ILoggerInternal.hpp"

#include "silkit/util/Span.hpp"

#include <unordered_map>
Expand Down
4 changes: 2 additions & 2 deletions SilKit/source/services/orchestration/TimeSyncService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ void TimeSyncService::ExecuteSimStep(std::chrono::nanoseconds timePoint, std::ch

// Timing and metrics of the handler execution time
const auto executionDuration = _simStepHandlerExecTimeMonitor.CurrentDuration();

const auto executionDurationMs = std::chrono::duration_cast<DoubleMSecs>(executionDuration);
const auto executionDurationS = std::chrono::duration_cast<DoubleSecs>(executionDuration);
_simStepHandlerExecutionTimeStatisticMetric->Take(executionDurationS.count());
Expand Down Expand Up @@ -555,6 +554,7 @@ void TimeSyncService::CompleteSimulationStep()
{
_logger->Debug("CompleteSimulationStep()");
}

_participant->ExecuteDeferred([this] {

// Timing and metrics of the completion time
Expand Down Expand Up @@ -733,7 +733,7 @@ void TimeSyncService::HybridWait(std::chrono::nanoseconds targetWaitDuration)
{
auto timeBeforeSleep = std::chrono::steady_clock::now();
// Wait the share of the targetWaitDuration that we can precisely achieve with the low timer resolution
auto sleepDuration = targetWaitDuration - defaultTimerResolution;
auto sleepDuration = targetWaitDuration - defaultTimerResolution;
std::this_thread::sleep_for(sleepDuration);
// Busy-wait the remainder
auto remainder = targetWaitDuration - (std::chrono::steady_clock::now() - timeBeforeSleep);
Expand Down

0 comments on commit 024a760

Please sign in to comment.