PPTC & Pool Enhancements. (#1968)
* PPTC & Pool Enhancements.
* Avoid buffer allocations in CodeGenContext.GetCode(). Avoid stream allocations in PTC.PtcInfo.
Refactoring/nits.
* Use XXHash128, for Ptc.Load & Ptc.Save, x10 faster than Md5.
* Why not a nice Span.
* Added a simple PtcFormatter library for deserialization/serialization, which does not require reflection, in use at PtcJumpTable and PtcProfiler; improves maintainability and simplicity/readability of affected code.
* Nits.
* Revert #1987.
* Revert "Revert #1987."
This reverts commit 998be765cf
.
This commit is contained in:
@ -4,11 +4,6 @@ namespace ARMeilleure.IntermediateRepresentation
|
||||
{
|
||||
static class OperationHelper
|
||||
{
|
||||
public static Operation Operation()
|
||||
{
|
||||
return ThreadStaticPool<Operation>.Instance.Allocate();
|
||||
}
|
||||
|
||||
public static Operation Operation(Instruction instruction, Operand destination)
|
||||
{
|
||||
return Operation().With(instruction, destination);
|
||||
@ -46,19 +41,26 @@ namespace ARMeilleure.IntermediateRepresentation
|
||||
return Operation().With(instruction, destinations, sources);
|
||||
}
|
||||
|
||||
public static void PrepareOperationPool(bool highCq)
|
||||
#region "ThreadStaticPool"
|
||||
public static void PrepareOperationPool(int groupId = 0)
|
||||
{
|
||||
ThreadStaticPool<Operation>.PreparePool(highCq ? 1 : 0);
|
||||
ThreadStaticPool<Operation>.PreparePool(groupId, ChunkSizeLimit.Medium);
|
||||
}
|
||||
|
||||
public static void ReturnOperationPool(bool highCq)
|
||||
private static Operation Operation()
|
||||
{
|
||||
ThreadStaticPool<Operation>.ReturnPool(highCq ? 1 : 0);
|
||||
return ThreadStaticPool<Operation>.Instance.Allocate();
|
||||
}
|
||||
|
||||
public static void ResetOperationPools()
|
||||
public static void ResetOperationPool(int groupId = 0)
|
||||
{
|
||||
ThreadStaticPool<Operation>.ResetPools();
|
||||
ThreadStaticPool<Operation>.ResetPool(groupId);
|
||||
}
|
||||
|
||||
public static void DisposeOperationPools()
|
||||
{
|
||||
ThreadStaticPool<Operation>.DisposePools();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user