sokil/php-2q 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sokil/php-2q

最新稳定版本:0.0.1

Composer 安装命令:

composer require sokil/php-2q

包简介

2Q cache implementation

README 文档

README

Coverage Status

The Q2 cache algorithm is a caching algorithm that aims to balance between frequently accessed and infrequently accessed items in a cache. It works by dividing the cache into three buffers: a frequently accessed buffer (in), a moderately accessed buffer (out), and an infrequently accessed buffer (main). The "in" is the smallest buffer and contains the most frequently accessed items. The "out" buffer is larger and contains items that are accessed less frequently than those in the "in" but more frequently than those in the "main". The "main" is the largest buffer and contains items that are rarely accessed.

See full description in https://www.vldb.org/conf/1994/P439.PDF

Installation

composer req sokil/php-2q

Usage

<?php

$cache = new TwoQCache(
    inQueueCapacity: 2,
    outQueueCapacity: 4,
    mainQueueCapacity: 2
);

$cache->set('key', 'value');
$cache->get('key');

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-14