Skip to content

Area cache #2

@QuinnBast

Description

@QuinnBast

Use a cache when events are triggered to be able to lookup the events faster within a hashmap. See https://github.com/EngineHub/WorldGuard/blob/af93530dbe9f420be20aa490d33c3fafb997aa0d/worldguard-core/src/main/java/com/sk89q/worldguard/protection/regions/QueryCache.java

Create a custom "CacheKey" to be used as the key which stores the polygon and can then check if the location in question is contained. Can use a priorty queue based on how many times the location has been 'hit' with events in a period of time.

https://leetcode.com/problems/top-k-frequent-words/discuss/108346/My-simple-Java-solution-using-HashMap-and-PriorityQueue-O(nlogk)-time-and-O(n)-space/119001

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions