Skip to content

chethiya/ballerina-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ballerina-cache

LRUCache

An LRU cache implementation for ballerina-lang

This can be used as an alternative to Cache in Stadnard Library which has a sub-optimal time complexity. You can find the issue regarding the sub-optimality here.

Also you can find a detailed comparison between two implementaions here in my blog post.

One of the key differences between this implementaion and the Stdlib Cache is the removal of evication factor which is not needed. Also this implemeantion supports the option to expire based on last access time, or last PUT time (ignoreing GET). That is quite useful in many practical scenarios where you have to cache page/search results for a fix period since PUT operation, irrespective of how frequently you read those results.

You can pull this module from Ballerina Central using following command:

ballerina pull chethiya/cache

About

An LRU cache implementation for ballerina-lang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published