Skip to content

Commit

Permalink
chore: release 0.12.0 (#755)
Browse files Browse the repository at this point in the history
* chore: release 0.12.0

Signed-off-by: MrCroxx <[email protected]>

* doc: update change log

Signed-off-by: MrCroxx <[email protected]>

* doc: update examples in readme

Signed-off-by: MrCroxx <[email protected]>

* chore: update changelog

Signed-off-by: MrCroxx <[email protected]>

* chore: update changelog

Signed-off-by: MrCroxx <[email protected]>

---------

Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx authored Oct 9, 2024
1 parent 726a5f5 commit cf53a60
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 38 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@ date: 2023-05-12T11:02:09+08:00

<!-- truncate -->

## 2024-10-09

### Releases

| crate | version |
| - | - |
| foyer | 0.12.0 |
| foyer-common | 0.12.0 |
| foyer-intrusive | 0.12.0 |
| foyer-memory | 0.12.0 |
| foyer-storage | 0.12.0 |
| foyer-bench | 0.12.0 |

### Changes

- Align the versions of all components to the same. 📣
- Introduce small object disk cache. 🎉
- Introduce mixed/large/small storage engine.
- Refactor builders for the hybrid cache.
- Introduce submit queue size threshold to prevent from channel piling up.
- Support `jeprof` for foyer-bench.
- Rename feature "mtrace" to "tracing".

## 2024-09-25

### Releases
Expand Down
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ members = [
]

[workspace.package]
version = "0.12.0-dev"
version = "0.12.0"
edition = "2021"
rust-version = "1.81.0"
repository = "https://github.com/foyer-rs/foyer"
Expand Down Expand Up @@ -47,11 +47,11 @@ clap = { version = "4", features = ["derive"] }
bytesize = { package = "foyer-bytesize", version = "2" }
hashbrown = "0.15"
# foyer components
foyer-common = { version = "0.12.0-dev", path = "foyer-common" }
foyer-intrusive = { version = "0.12.0-dev", path = "foyer-intrusive" }
foyer-memory = { version = "0.12.0-dev", path = "foyer-memory" }
foyer-storage = { version = "0.12.0-dev", path = "foyer-storage" }
foyer = { version = "0.12.0-dev", path = "foyer" }
foyer-common = { version = "0.12.0", path = "foyer-common" }
foyer-intrusive = { version = "0.12.0", path = "foyer-intrusive" }
foyer-memory = { version = "0.12.0", path = "foyer-memory" }
foyer-storage = { version = "0.12.0", path = "foyer-storage" }
foyer = { version = "0.12.0", path = "foyer" }

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(madsim)'] }
Expand Down
68 changes: 36 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ Feel free to open a PR and add your projects here:
To use *foyer* in your project, add this line to the `dependencies` section of `Cargo.toml`.

```toml
foyer = "0.11"
foyer = "0.12"
```

If your project is using the nightly rust toolchain, the `nightly` feature needs to be enabled.

```toml
foyer = { version = "0.11", features = ["nightly"] }
foyer = { version = "0.12", features = ["nightly"] }
```

### Out-of-the-box In-memory Cache
Expand All @@ -90,20 +90,16 @@ fn main() {
### Easy-to-use Hybrid Cache

```rust
use foyer::{DirectFsDeviceOptionsBuilder, HybridCache, HybridCacheBuilder};
use foyer::{DirectFsDeviceOptions, Engine, HybridCache, HybridCacheBuilder};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
let dir = tempfile::tempdir()?;

let hybrid: HybridCache<u64, String> = HybridCacheBuilder::new()
.memory(64 * 1024 * 1024)
.storage()
.with_device_config(
DirectFsDeviceOptionsBuilder::new(dir.path())
.with_capacity(256 * 1024 * 1024)
.build(),
)
.storage(Engine::Large) // use large object disk cache engine only
.with_device_options(DirectFsDeviceOptions::new(dir.path()).with_capacity(256 * 1024 * 1024))
.build()
.await?;

Expand All @@ -125,8 +121,8 @@ use std::sync::Arc;
use anyhow::Result;
use chrono::Datelike;
use foyer::{
DirectFsDeviceOptionsBuilder, FifoPicker, HybridCache, HybridCacheBuilder, LruConfig, RateLimitPicker, RecoverMode,
RuntimeConfig, TokioRuntimeConfig, TombstoneLogConfigBuilder,
DirectFsDeviceOptions, Engine, FifoPicker, HybridCache, HybridCacheBuilder, LargeEngineOptions, LruConfig,
RateLimitPicker, RecoverMode, RuntimeOptions, SmallEngineOptions, TokioRuntimeOptions, TombstoneLogConfigBuilder,
};
use tempfile::tempdir;

Expand All @@ -143,40 +139,48 @@ async fn main() -> Result<()> {
.with_object_pool_capacity(1024)
.with_hash_builder(ahash::RandomState::default())
.with_weighter(|_key, value: &String| value.len())
.storage()
.with_device_config(
DirectFsDeviceOptionsBuilder::new(dir.path())
.storage(Engine::Mixed(0.1))
.with_device_options(
DirectFsDeviceOptions::new(dir.path())
.with_capacity(64 * 1024 * 1024)
.with_file_size(4 * 1024 * 1024)
.build(),
.with_file_size(4 * 1024 * 1024),
)
.with_flush(true)
.with_indexer_shards(64)
.with_recover_mode(RecoverMode::Quiet)
.with_recover_concurrency(8)
.with_flushers(2)
.with_reclaimers(2)
.with_buffer_threshold(256 * 1024 * 1024)
.with_clean_region_threshold(4)
.with_eviction_pickers(vec![Box::<FifoPicker>::default()])
.with_admission_picker(Arc::new(RateLimitPicker::new(100 * 1024 * 1024)))
.with_reinsertion_picker(Arc::new(RateLimitPicker::new(10 * 1024 * 1024)))
.with_compression(foyer::Compression::Lz4)
.with_tombstone_log_config(
TombstoneLogConfigBuilder::new(dir.path().join("tombstone-log-file"))
.with_flush(true)
.build(),
)
.with_runtime_config(RuntimeConfig::Separated {
read_runtime_config: TokioRuntimeConfig {
.with_runtime_options(RuntimeOptions::Separated {
read_runtime_options: TokioRuntimeOptions {
worker_threads: 4,
max_blocking_threads: 8,
},
write_runtime_config: TokioRuntimeConfig {
write_runtime_options: TokioRuntimeOptions {
worker_threads: 4,
max_blocking_threads: 8,
},
})
.with_large_object_disk_cache_options(
LargeEngineOptions::new()
.with_indexer_shards(64)
.with_recover_concurrency(8)
.with_flushers(2)
.with_reclaimers(2)
.with_buffer_pool_size(256 * 1024 * 1024)
.with_clean_region_threshold(4)
.with_eviction_pickers(vec![Box::<FifoPicker>::default()])
.with_reinsertion_picker(Arc::new(RateLimitPicker::new(10 * 1024 * 1024)))
.with_tombstone_log_config(
TombstoneLogConfigBuilder::new(dir.path().join("tombstone-log-file"))
.with_flush(true)
.build(),
),
)
.with_small_object_disk_cache_options(
SmallEngineOptions::new()
.with_set_size(16 * 1024)
.with_set_cache_capacity(64)
.with_flushers(2),
)
.build()
.await?;

Expand Down

0 comments on commit cf53a60

Please sign in to comment.