Skip to content

Commit

Permalink
Disable the quanta feature by default
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuya6502 committed Jan 5, 2025
1 parent d22f4f3 commit 0a6b6a4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,8 @@ jobs:
- name: Run tests (future feature, but no sync feature)
run: cargo test --features future

- name: Run tests (release, future feature, but no sync feature)
run: cargo test --release --features future

- name: Run tests (future, sync and logging features)
run: cargo test --features 'future, sync, logging'
2 changes: 1 addition & 1 deletion .github/workflows/CIArm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Run tests (sync feature, drop cache)
run: cargo test --release --lib --features sync sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored

- name: Run tests (future feature, but no sync feature)
- name: Run tests (future feature)
run: cargo test --features future
env:
RUSTFLAGS: '--cfg skip_large_mem_tests'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI (Quanta disabled)
name: CI (Quanta enabled)

on:
push:
Expand Down Expand Up @@ -67,21 +67,27 @@ jobs:
if: ${{ matrix.rust == '1.70.0' }}
run: ./.ci_extras/remove-examples-msrv.sh

- name: Run tests (debug, but no quanta feature)
run: cargo test --no-default-features --features sync
- name: Show cargo tree
run: cargo tree --features 'sync, future, quanta'

- name: Run tests (debug, sync, quanta features)
run: cargo test --features 'sync, quanta'
env:
RUSTFLAGS: '--cfg rustver'

- name: Run tests (release, but no quanta feature)
run: cargo test --release --no-default-features --features sync
- name: Run tests (release, sync, quanta features)
run: cargo test --release --features 'sync, quanta'
env:
RUSTFLAGS: '--cfg rustver'

- name: Run tests (future feature, but no quanta and sync features)
run: cargo test --no-default-features --features future
- name: Run tests (debug, future, quanta features)
run: cargo test --features 'future, quanta'

- name: Run tests (release, future, quanta features)
run: cargo test --release --features 'future, quanta'

- name: Run tests (future, sync and logging features, but no quanta feature)
run: cargo test --no-default-features --features 'sync, future, logging'
- name: Run tests (future, sync, logging, quanta features)
run: cargo test --features 'sync, future, quanta, logging'

- name: Run tests (sync feature, but no quanta feature, drop cache)
run: cargo test --release --lib --no-default-features --features sync sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored
- name: Run tests (sync, quanta features, drop cache)
run: cargo test --release --lib --features 'sync, quanta' sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored
4 changes: 2 additions & 2 deletions .github/workflows/Codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
env:
RUSTFLAGS: '--cfg rustver'

- name: Run tests (no quanta feature)
run: cargo llvm-cov --no-report --no-default-features --features 'sync, future'
- name: Run tests (with quanta feature)
run: cargo llvm-cov --no-report --features 'sync, future, quanta'
env:
RUSTFLAGS: '--cfg rustver'

Expand Down
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exclude = [".devcontainer", ".github", ".gitpod.yml", ".vscode"]
build = "build.rs"

[features]
default = ["quanta"]
default = []

# Enable this feature to use `moka::sync::{Cache, SegmentedCache}`
sync = []
Expand All @@ -29,8 +29,10 @@ future = ["async-lock", "event-listener", "futures-util"]
# callback closure.
logging = ["log"]

# This feature is enabled by default. It will slightly speed up some cache operations
# by using the `quanta` crate to measure time.
# Enable this feature to use `quanta::Instant` in some performance critical
# operations in the cache instead of `std::time::Instant`. As of v0.12.10, this
# feature will not make any noticeable performance difference, but in the future
# when cache metrics are added, it will be useful to have this feature enabled.
quanta = ["dep:quanta"]

# This is an old feature and has no effect in v0.12.10 or newer. It is kept for
Expand Down

0 comments on commit 0a6b6a4

Please sign in to comment.