Skip to content

Commit

Permalink
UPM package version 1.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored Feb 22, 2020
1 parent 0a181dd commit 685d320
Show file tree
Hide file tree
Showing 103 changed files with 508 additions and 362 deletions.
2 changes: 1 addition & 1 deletion BreakIt.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Collections.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Collections/ParallelTaskCollection.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Collections/SerialTaskCollection.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Collections/TaskCollection.StructFriendlyStack.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Collections/TaskCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ public override string ToString()
CollectionTask _currentTask;
int _currentStackIndex;
readonly FasterList<StructFriendlyStack> _listOfStacks;
T _current;
string _name;

const int _INITIAL_STACK_SIZE = 1;
Expand Down
2 changes: 1 addition & 1 deletion Collections/TaskCollection.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ContinuationWrapperPool.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DBC.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/ActionEnumerators.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Enumerators/ActionEnumerators/SmartFunctionEnumerator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using Svelto.Utilities;

Expand All @@ -10,7 +9,7 @@ namespace Svelto.Tasks.Enumerators
/// <typeparam name="T">
/// facilitate the use of counters that can be passed by reference to the callback function
/// </typeparam>
public class SmartFunctionEnumerator<T>:IEnumerator, IEnumerator<T>
public class SmartFunctionEnumerator<T>: IEnumerator<T>
{
public SmartFunctionEnumerator(FuncRef<T, bool> func)
{
Expand Down Expand Up @@ -60,6 +59,5 @@ public void Dispose()
T _value;

string _name;
T _current;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/EnumeratorWithProgress.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/ExceptionHandlingEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/ReusableWaitForSecondsEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/TaskServiceEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/Unity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/Unity/AsyncOperationEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/Unity/UnityWebRequestEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/Unity/WWWEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/Unity/YieldInstructionEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/WaitForSecondsEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Enumerators/WaitForSignalEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ITaskRoutine.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LICENSE.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Parallelism.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Parallelism/ISveltoJob.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Parallelism/MultiThreadedParallelTaskCollection.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Parallelism/ParallelRunEnumerator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Profiler.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Profiler/Pix.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Profiler/Pix/PIXWrapper.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 49 additions & 52 deletions Profiler/TaskInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#if TASKS_PROFILER_ENABLED
using System;
using System.Collections.Generic;

//This profiler is based on the Entitas Visual Debugging tool
//https://github.com/sschmid/Entitas-CSharp
Expand All @@ -9,70 +8,68 @@ namespace Svelto.Tasks.Profiler
{
public struct TaskInfo
{
const int NUM_FRAMES_TO_AVERAGE = 100;

public string taskName { get { return _threadInfo.FastConcat(_taskName); } }
public double lastUpdateDuration { get { return _lastUpdateDuration; } }
public double minUpdateDuration { get { return _minUpdateDuration; } }
public double maxUpdateDuration { get { return _maxUpdateDuration; } }
public double currentUpdateDuration { get { return _updateFrameTimes.Count == 0 ? 0 : _currentUpdateDuration / _updateFrameTimes.Count; } }
public double averageUpdateDuration { get { return _averageUpdateDuration / _totaleFrames; } }

public TaskInfo(string name) : this()
public string taskName => _taskName;
public double minUpdateDuration => _minUpdateDuration;
public double maxUpdateDuration => _maxUpdateDuration;
public float currentUpdateDuration => times[_frame];
public float averageUpdateDuration
{
_taskName = " ".FastConcat(name);

_updateFrameTimes = new Queue<double>();

_currentUpdateDuration = 0;
_averageUpdateDuration = 0;
_minUpdateDuration = 0;
_maxUpdateDuration = 0;
_totaleFrames = 0;
_updateFrameTimes.Clear();
get
{
float sum = 0;
var length = ITERATIONS >> 2;
for (int i = 0; i < length; i++)
{
var index = i << 2;

sum += times[index];
sum += times[index + 1];
sum += times[index + 2];
sum += times[index + 3];
}

return sum / ITERATIONS;
}
}

public void AddUpdateDuration(double updateDuration)
public uint deltaCalls => _deltaCalls;

public TaskInfo(string name, string runnerName) : this()
{
AddUpdateDurationForType(updateDuration);
_taskName = " ".FastConcat(name, ":", runnerName);
times = new float[ITERATIONS];
}

public void AddThreadInfo(string threadInfo)
public void AddUpdateDuration(float updateDuration)
{
_threadInfo = threadInfo;
_currentUpdateDuration += updateDuration;

_deltaCalls++;
}

void AddUpdateDurationForType(double updateDuration)
public void MarkNextFrame()
{
if ((updateDuration < _minUpdateDuration) || (Math.Abs(_minUpdateDuration) < double.Epsilon))
_minUpdateDuration = updateDuration;
if (updateDuration > _maxUpdateDuration)
_maxUpdateDuration = updateDuration;

if (_updateFrameTimes.Count == NUM_FRAMES_TO_AVERAGE)
_currentUpdateDuration -= _updateFrameTimes.Dequeue();

_currentUpdateDuration += updateDuration;
_averageUpdateDuration += updateDuration;
_updateFrameTimes.Enqueue(updateDuration);
_lastUpdateDuration = updateDuration;
_totaleFrames++;
if (_frame == 0)
{
_minUpdateDuration = float.MaxValue;
_maxUpdateDuration = float.MinValue;
}

if (_currentUpdateDuration < _minUpdateDuration) _minUpdateDuration = _currentUpdateDuration;
if (_currentUpdateDuration > _maxUpdateDuration) _maxUpdateDuration = _currentUpdateDuration;

times[_frame] = _currentUpdateDuration;
_frame = (_frame + 1) & (ITERATIONS - 1);

_deltaCalls = 0;
_currentUpdateDuration = 0;
}

double _currentUpdateDuration;
double _averageUpdateDuration;
double _lastUpdateDuration;
double _maxUpdateDuration;
double _minUpdateDuration;

double _totaleFrames;

float _currentUpdateDuration; float _maxUpdateDuration; float _minUpdateDuration;
uint _deltaCalls; uint _frame;
readonly string _taskName;
readonly float[] times;

string _threadInfo;

//use a queue to averave out the last 30 frames
readonly Queue<double> _updateFrameTimes;
const int ITERATIONS = 32;
}
}
#endif
2 changes: 1 addition & 1 deletion Profiler/TaskInfo.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 685d320

Please sign in to comment.