Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Faster world lookup #4420

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Vrganj
Copy link
Contributor

@Vrganj Vrganj commented May 5, 2024

Description

Make world lookup faster using an IdentityHashMap and computeIfAbsent.

Submitter Checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter Checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
    Options
  2. Ensure that the pull request title represents the desired changelog entry.
    Options
  3. New public fields and methods are annotated with @since TODO.
    Options
  4. I read and followed the contribution guidelines.
    Options

@Vrganj Vrganj requested a review from a team as a code owner May 5, 2024 16:06
@NotMyFault NotMyFault requested a review from a team May 19, 2024 18:11
@NotMyFault NotMyFault added the Enhancement New feature or request label May 19, 2024
@dordsor21
Copy link
Member

I do not think we want to be forcing BukkitWorld objects to be kept in memory, as if a world is unloaded and loaded again we'll have garbage objects kept in the map that won't be removed. Elsewhere (somewhere in P2 and/or FAWE) we reference worlds with a WeakReference to ensure we do not do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants