Conversation
| [TestClass] | ||
| public class UT_ReversePoolItemComparer : UT_PoolItem | ||
| { | ||
| public UT_ReversePoolItemComparer() : base(ReversePoolItemComparer.Instance, -1) { } |
There was a problem hiding this comment.
Same tests, but reversed
|
@Jim8y could you help me with benchmarks here? |
| { | ||
| if (otherTx == null) return 1; | ||
| int ret = (Tx.GetAttribute<HighPriorityAttribute>() != null).CompareTo(otherTx.GetAttribute<HighPriorityAttribute>() != null); | ||
| var ret = (Tx.GetAttribute<HighPriorityAttribute>() != null) |
There was a problem hiding this comment.
Maybe for the _sortedTransactions there will be an effect, no?
There was a problem hiding this comment.
This return the same, is inverted later
|
Before:
After:
I dont see much performance difference, basically the same. |
Seems slower? 🫣 |
| private static NeoSystem MockNeoSystem() | ||
| { | ||
| // Use reflection to create a minimal NeoSystem without initializing all components | ||
| var constructor = typeof(NeoSystem).GetConstructor( |
There was a problem hiding this comment.
Is it possible to use Internal Visiable To?
| /// <summary> | ||
| /// A class that mimics the behavior of the internal PoolItem for MemoryPool benchmarks | ||
| /// </summary> | ||
| public class TestMemPoolItem : IComparable<TestMemPoolItem> |
There was a problem hiding this comment.
Duplicated PoolItem.
Is it possible to use Internal Visiable To?(Same as calling MemoryPool internal methods)
|
Closed because no speed up |
Description
I don't know why we always reverse the iterator in these two sorted set, @roman-khimov could you check these changes please.
This could helps with tps because it improves the memPool management.
Type of change
How Has This Been Tested?
UT_ReversePoolItemComparerTest Configuration:
Checklist: