You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe it is not bug, only some things which affect the performance. After adding the ‘this.itemCount = 0;’, the performance is higher than default. it seems that the default clean forge to set the itemCount to zero.
Could we do like this and it is safe? @hg-ms , thank you in advance!
To Reproduce
Use LazyArrayList as DataRoot, write and delete very frequently. and log the write/delete time cost, you will find the write/delete cost is relative high, maybe 10ms-200ms. I only used 2k threads to write/delete, I wrapper the LazyArrayList by a ReadWriteLock for concurrently operation.
Expected behavior
the write/delete cost will be small.
Screenshots
Additional context
The text was updated successfully, but these errors were encountered:
Thanks for the issue, this should be fixed.
The itemCount should be set to zero when (re)initializing a storer instance. If not it will add up if a storer instance is used several times and can cause unnecessary resizing of the internal Item array.
Environment Details
Describe the bug
Maybe it is not bug, only some things which affect the performance. After adding the ‘this.itemCount = 0;’, the performance is higher than default. it seems that the default clean forge to set the itemCount to zero.
` protected void internalInitialize(final int hashLength)
{
synchronized(this.head)
{
this.itemCount = 0;
this.hashSlots = new Item[hashLength];
this.hashRange = hashLength - 1;
Could we do like this and it is safe? @hg-ms , thank you in advance!
To Reproduce
Use LazyArrayList as DataRoot, write and delete very frequently. and log the write/delete time cost, you will find the write/delete cost is relative high, maybe 10ms-200ms. I only used 2k threads to write/delete, I wrapper the LazyArrayList by a ReadWriteLock for concurrently operation.
Expected behavior
the write/delete cost will be small.
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: