Skip to content

Commit 0a6b6a4

Browse files
committed
Disable the quanta feature by default
1 parent d22f4f3 commit 0a6b6a4

File tree

5 files changed

+28
-17
lines changed

5 files changed

+28
-17
lines changed

.github/workflows/CI.yml

+3
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,8 @@ jobs:
103103
- name: Run tests (future feature, but no sync feature)
104104
run: cargo test --features future
105105

106+
- name: Run tests (release, future feature, but no sync feature)
107+
run: cargo test --release --features future
108+
106109
- name: Run tests (future, sync and logging features)
107110
run: cargo test --features 'future, sync, logging'

.github/workflows/CIArm64.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Run tests (sync feature, drop cache)
5656
run: cargo test --release --lib --features sync sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored
5757

58-
- name: Run tests (future feature, but no sync feature)
58+
- name: Run tests (future feature)
5959
run: cargo test --features future
6060
env:
6161
RUSTFLAGS: '--cfg skip_large_mem_tests'

.github/workflows/CIQuantaDisabled.yml renamed to .github/workflows/CIQuantaEnabled.yml

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI (Quanta disabled)
1+
name: CI (Quanta enabled)
22

33
on:
44
push:
@@ -67,21 +67,27 @@ jobs:
6767
if: ${{ matrix.rust == '1.70.0' }}
6868
run: ./.ci_extras/remove-examples-msrv.sh
6969

70-
- name: Run tests (debug, but no quanta feature)
71-
run: cargo test --no-default-features --features sync
70+
- name: Show cargo tree
71+
run: cargo tree --features 'sync, future, quanta'
72+
73+
- name: Run tests (debug, sync, quanta features)
74+
run: cargo test --features 'sync, quanta'
7275
env:
7376
RUSTFLAGS: '--cfg rustver'
7477

75-
- name: Run tests (release, but no quanta feature)
76-
run: cargo test --release --no-default-features --features sync
78+
- name: Run tests (release, sync, quanta features)
79+
run: cargo test --release --features 'sync, quanta'
7780
env:
7881
RUSTFLAGS: '--cfg rustver'
7982

80-
- name: Run tests (future feature, but no quanta and sync features)
81-
run: cargo test --no-default-features --features future
83+
- name: Run tests (debug, future, quanta features)
84+
run: cargo test --features 'future, quanta'
85+
86+
- name: Run tests (release, future, quanta features)
87+
run: cargo test --release --features 'future, quanta'
8288

83-
- name: Run tests (future, sync and logging features, but no quanta feature)
84-
run: cargo test --no-default-features --features 'sync, future, logging'
89+
- name: Run tests (future, sync, logging, quanta features)
90+
run: cargo test --features 'sync, future, quanta, logging'
8591

86-
- name: Run tests (sync feature, but no quanta feature, drop cache)
87-
run: cargo test --release --lib --no-default-features --features sync sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored
92+
- name: Run tests (sync, quanta features, drop cache)
93+
run: cargo test --release --lib --features 'sync, quanta' sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored

.github/workflows/Codecov.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
env:
2929
RUSTFLAGS: '--cfg rustver'
3030

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

Cargo.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ exclude = [".devcontainer", ".github", ".gitpod.yml", ".vscode"]
1616
build = "build.rs"
1717

1818
[features]
19-
default = ["quanta"]
19+
default = []
2020

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

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

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

0 commit comments

Comments
 (0)