Skip to content

Add a cache eviction policy for parseCache #45

Open
@mayankpruthii

Description

@mayankpruthii

Whenever JsonLogic's apply method is called for a json rule, it puts the json rule in a cache called parseCache in src/JsonLogic.java and creates a JsonLogicNode object from the stringified json rule. This cache helps in redundant calls for parsing the same json rule to the JsonLogicNode parser.

But the cache does not have any conviction policy. If the consumer ends up calling JsonLogic.apply for multiple distinct rules, the cache can quickly fill up the memory of the system and cause performance bottlenecks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions