From 9ef3d98de72b496a6d219d6d58d1697ff7a83e03 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 19 Jun 2023 01:51:48 +0200 Subject: [PATCH] Job-Planning: replace FrameCoord by direct references ...in the hope that the Optimiser is able to elide those references entirely, when (as is here the case) they point into another field of a larger object compound --- src/steam/engine/job-planning.hpp | 20 ++++---- tests/core/steam/engine/job-planning-test.cpp | 9 ++-- wiki/thinkPad.ichthyo.mm | 51 +++++++++++++++++-- 3 files changed, 61 insertions(+), 19 deletions(-) diff --git a/src/steam/engine/job-planning.hpp b/src/steam/engine/job-planning.hpp index 6b9428697..87c2878a3 100644 --- a/src/steam/engine/job-planning.hpp +++ b/src/steam/engine/job-planning.hpp @@ -54,6 +54,7 @@ #include "lib/time/timevalue.hpp" //#include "lib/iter-explorer.hpp" //#include "lib/iter-adapter.hpp" +#include "lib/nocopy.hpp" #include "lib/util.hpp" @@ -89,16 +90,17 @@ namespace engine { * @todo WIP-WIP 6/2023 reworking the job-planning pipeline for »PlaybackVerticalSlice« */ class JobPlanning + : util::MoveOnly { - FrameCoord frameCoord_; - JobTicket& jobTicket_; - DataSink& outputSink_; + JobTicket& jobTicket_; + Time const& nominalTime_; + FrameCnt const& frameNr_; public: - JobPlanning(FrameCoord frame, JobTicket& ticket, DataSink& sink) - : frameCoord_{frame} - , jobTicket_{ticket} - , outputSink_{sink} + JobPlanning(JobTicket& ticket, Time const& nominalTime, FrameCnt const& frameNr) + : jobTicket_{ticket} + , nominalTime_{nominalTime} + , frameNr_{frameNr} { } @@ -112,7 +114,7 @@ namespace engine { Job buildJob() { - Job job = jobTicket_.createJobFor (frameCoord_.absoluteNominalTime); + Job job = jobTicket_.createJobFor (Time{nominalTime_}); //////////////////////////////////////////////////////TICKET #1295 : somehow package and communicate the DataSink info return job; } @@ -132,7 +134,7 @@ namespace engine { return Time::ANYTIME; case play::TIMEBOUND: - return timings.getTimeDue(frameCoord_.absoluteFrameNumber) + return timings.getTimeDue(frameNr_) - totalLatency(timings); } NOTREACHED ("unexpected playbackUrgency"); diff --git a/tests/core/steam/engine/job-planning-test.cpp b/tests/core/steam/engine/job-planning-test.cpp index e2ad9f9d5..02e676674 100644 --- a/tests/core/steam/engine/job-planning-test.cpp +++ b/tests/core/steam/engine/job-planning-test.cpp @@ -112,12 +112,12 @@ namespace test { play::Timings timings (FrameRate::PAL); auto [port,sink] = dispatcher.getDummyConnection(1); - Time nominalTime{200,0}; + FrameCnt frameNr{5}; + TimeVar nominalTime{Time{200,0}}; size_t portIDX = dispatcher.resolveModelPort (port); JobTicket& ticket = dispatcher.getJobTicketFor(portIDX, nominalTime); - FrameCoord frame{nominalTime, portIDX}; /////////////////////////////OOO replace FrameCoord - JobPlanning plan{frame,ticket,sink}; + JobPlanning plan{ticket,nominalTime,frameNr}; Job job = plan.buildJob(); CHECK (dispatcher.verify (job, port, sink)); @@ -140,8 +140,7 @@ namespace test { size_t portIDX = dispatcher.resolveModelPort (port); JobTicket& ticket = dispatcher.getJobTicketFor(portIDX, nominalTime); - FrameCoord frame{nominalTime, frameNr, portIDX}; /////////////////////////////OOO replace FrameCoord - JobPlanning plan{frame,ticket,sink}; + JobPlanning plan{ticket,nominalTime,frameNr}; // the following calculations are expected to happen.... Duration latency = ticket.getExpectedRuntime() diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 7ab77e458..a4520462b 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -75947,7 +75947,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + @@ -75958,6 +75958,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200

+ @@ -75979,7 +75980,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + @@ -76066,12 +76067,12 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + - + @@ -76082,6 +76083,46 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + +
+
+ + + + + + + + + + + + + + + + +

+ leider ist das ziemlich abschüssiges Gelände +

+ +
+ + + + + +

+ ....per SFINAE feststellen, daß ein Asignment-Operator unterdrückt wurde; lt. Standard sollte das gehen (das war eine späte Änderung zu C++11, da es in der Stdlib so viel Probleme gemacht hat) — aber in der Praxis weiß ich, daß das fragil ist, manchmal Fehler auslösen kann (statt SFINAE), und daß es Diskrepanzen zwischen den Compilern gibt. Ich hatte auch schon Fälle, wo std::is_assignable rundweg versagt hat.... +

+ +
+
+ + +