Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Cache use RedRandom - #6740

Merged
NateBrady23 merged 7 commits into
TechEmpower:masterfrom
redkale:master
Aug 17, 2021
Merged

NateBrady23 merged 7 commits into
TechEmpower:masterfrom
redkale:master

Conversation

@redkale

@redkale redkale commented Jul 30, 2021

Copy link
Copy Markdown
Contributor

No description provided.

}
final int size = Math.min(500, Math.max(1, q));
return cache.random(ThreadLocalRandom.current(), size);
return cache.random(cached ? rands.get() : ThreadLocalRandom.current(), size);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random numbers should never be cached? What is this doing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cached-worlds use RedRandom.class other use ThreadLocalRandom
look at the performance difference between the two

@NateBrady23
NateBrady23 merged commit e42e57d into TechEmpower:master Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants