Skip to content

vaavaav/SHARDS-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SHARDS-cpp

This is an implementation of the miss ratio curve online construction technique SHARDS in C++. It is heavily inspired in SHARDS-C, a fanmade implementation in C.

Integration through CMake

include_subdirectory(path/to/SHARDS-cpp)
# or find_package(Shards REQUIRED) if you instead installed Shards in your system
target_link_libraries(your_target Shards)

How to use SHARDS

After including the header file, you can use SHARDS by using a building function for the desired strategy: Fixed Rate or Fixed Size. Example code:

#include <cstdint>
#include <Shards/Shards.h>

int main() {

    Shards * shards = Shards::fixedSize(...);
    // or Shards * shards = Shards::fixedRate(...);

    // On lookups
    std::string const key = ...;
    shards->feed(key);

    // Generate Miss Ratio Curve
    std::map<uint32_t, double> mrc = shards->mrc();

    // Reset internal state if desired
    shards->clear();

    delete shards;

    return 0;
} 

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published