My question is: Did you use RDTSC instruction to measure performance of these two test-cases?
Here are pseudo-codes:
...
RaisePriorityToREALTIME
EnterCriticalSection
UseRDTSCtoTimeStart
DoCalculationsVersion1
UseRDTSCtoTimeEnd
LeaveCriticalSection
LowerPriorityToNORMAL
Print( TimeEnd - TimeStart )InClockCycles
...
and
...
RaisePriorityToREALTIME
EnterCriticalSection
UseRDTSCtoTimeStart
DoCalculationsVersion2
UseRDTSCtoTimeEnd
LeaveCriticalSection
LowerPriorityToNORMAL
Print( TimeEnd - TimeStart )InClockCycles
...
A verification / comparison of generated assembler codes for both versions would answer your question.
My question is: Did you use RDTSC instruction to measure performance of these two test-cases?
Here are pseudo-codes:
...
RaisePriorityToREALTIME
EnterCriticalSection
UseRDTSCtoTimeStart
DoCalculationsVersion1
UseRDTSCtoTimeEnd
LeaveCriticalSection
LowerPriorityToNORMAL
Print( TimeEnd - TimeStart )InClockCycles
...
and
...
RaisePriorityToREALTIME
EnterCriticalSection
UseRDTSCtoTimeStart
DoCalculationsVersion2
UseRDTSCtoTimeEnd
LeaveCriticalSection
LowerPriorityToNORMAL
Print( TimeEnd - TimeStart )InClockCycles
...
A verification / comparison of generated assembler codes for both versions would answer your question.