better perf

This commit is contained in:
Martino Ferrari
2026-02-25 16:51:07 +01:00
parent aaf69c0949
commit dfb399bbba
12 changed files with 713 additions and 633 deletions

View File

@@ -4,6 +4,7 @@
#include "StandardParser.h"
#include "StreamString.h"
#include "BasicUDPSocket.h"
#include "HighResolutionTimer.h"
#include <assert.h>
#include <stdio.h>
@@ -41,7 +42,8 @@ void TestFullTracePipeline() {
printf("Simulating cycles...\n");
for (int i=0; i<50; i++) {
mockValue = 1000 + i;
service.ProcessSignal(sig, sizeof(uint32));
uint64 ts = (uint64)((float64)HighResolutionTimer::Counter() * HighResolutionTimer::Period() * 1000000.0);
service.ProcessSignal(sig, sizeof(uint32), ts);
Sleep::MSec(10);
}
@@ -62,13 +64,14 @@ void TestFullTracePipeline() {
printf("Header: Magic=0x%X, Count=%u, Seq=%u\n", h->magic, h->count, h->seq);
uint32 offset = sizeof(TraceHeader);
if (size >= offset + 8) {
if (size >= offset + 16) {
uint32 recId = *(uint32*)(&buffer[offset]);
uint32 recSize = *(uint32*)(&buffer[offset + 4]);
printf("Data: ID=%u, Size=%u\n", recId, recSize);
if (size >= offset + 8 + recSize) {
uint64 recTs = *(uint64*)(&buffer[offset + 4]);
uint32 recSize = *(uint32*)(&buffer[offset + 12]);
printf("Data: ID=%u, TS=%lu, Size=%u\n", recId, recTs, recSize);
if (size >= offset + 16 + recSize) {
if (recSize == 4) {
uint32 recVal = *(uint32*)(&buffer[offset + 8]);
uint32 recVal = *(uint32*)(&buffer[offset + 16]);
printf("Value=%u\n", recVal);
}
}