Skip to content

Commit

Permalink
Pre-prepare phase job snapshot.
Browse files Browse the repository at this point in the history
  • Loading branch information
RossNordby committed Dec 7, 2023
1 parent 1cced13 commit 532404a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions BepuPhysics/CollisionDetection/CollidableOverlapFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ public void DispatchOverlaps3(float dt, IThreadDispatcher threadDispatcher = nul
var narrowTaskStack = new TaskStack(narrowPhase.Pool, threadDispatcher, threadDispatcher.ThreadCount);
broadStack = &broadTaskStack;
narrowStack = &narrowTaskStack;
const int targetJobsPerThread = 4;
const int targetJobsPerThread = 1;
int maximumTaskSize = int.Max(1, previousPairCount3 / (threadDispatcher.ThreadCount * targetJobsPerThread));
//Console.WriteLine($"maixmum taskese: {maximumTaskSize}");
var estimatedMaximumTaskCountPerThread = targetJobsPerThread * 2;
Expand Down Expand Up @@ -861,11 +861,11 @@ public void DispatchOverlaps3(float dt, IThreadDispatcher threadDispatcher = nul
previousPairCount3 = totalPairCount;
taskAccumulators.Dispose(narrowPhase.Pool);

Console.WriteLine();
Console.WriteLine($"min: {debugMinIndex}, {debugMin / (double)totalPairCount}");
Console.WriteLine($"max: {debugMaxIndex}, {debugMax / (double)totalPairCount}");
Console.WriteLine($"sum: {totalPairCount}");
Console.WriteLine($"TFC: {totalFlushCount}");
//Console.WriteLine();
//Console.WriteLine($"min: {debugMinIndex}, {debugMin / (double)totalPairCount}");
//Console.WriteLine($"max: {debugMaxIndex}, {debugMax / (double)totalPairCount}");
//Console.WriteLine($"sum: {totalPairCount}");
//Console.WriteLine($"TFC: {totalFlushCount}");

#if DEBUG
for (int i = 1; i < threadDispatcher.ThreadCount; ++i)
Expand Down

0 comments on commit 532404a

Please sign in to comment.