Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add foyer benchmark #20

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

MrCroxx
Copy link

@MrCroxx MrCroxx commented Apr 27, 2024

Hi, @tatsuya6502 .

Thanks a lot for creating the mokabench tools. mokabench is easy-to-use and easy-to-expand. I'm happy to add my cache crate foyer to mokabench if you like it.

foyer is a hybrid cache lib and support replaceable caching algorithms in a plug-and-play behavior.

This PR only uses default algorithm (w-TinyLFU) and in-memory cache only. I'm willing to add more configurations if you like place foyer in mokabench. So I make this PR a draft.

Thanks again for your efforts. Willing to hear from you.

Signed-off-by: MrCroxx <mrcroxx@outlook.com>
@MrCroxx
Copy link
Author

MrCroxx commented Apr 27, 2024

Here is a benchmark result with the example bench config:

Async runtime: Tokio
Config { trace_file: S3, ttl: None, tti: None, num_clients: Some([1, 3, 6]), repeat: None, insertion_delay: None, insert_once: false, invalidate: false, invalidate_all: false, invalidate_entries_if: false, iterate: false, eviction_listener: None, size_aware: false, entry_api: false, per_key_expiration: false }

Cache, Max Capacity, Clients, Inserts, Reads, Hit Ratio, Duration Secs
Mini Moka Unsync Cache, 100000, 1, 14695344, 16407702, 10.436, 3.213
QuickCache Sync Cache, 100000, 1, 14300798, 16407702, 12.841, 2.098
QuickCache Sync Cache, 100000, 3, 14300714, 16407702, 12.841, 2.443
QuickCache Sync Cache, 100000, 6, 14300924, 16407702, 12.840, 1.496
Foyer In-memory Cache, 100000, 1, 14860037, 16407702, 9.433, 4.477
Foyer In-memory Cache, 100000, 3, 14858311, 16407702, 9.443, 6.703
Foyer In-memory Cache, 100000, 6, 14859318, 16407702, 9.437, 4.727
Mini Moka Sync Cache, 100000, 1, 14695340, 16407702, 10.436, 6.740
Mini Moka Sync Cache, 100000, 3, 14698734, 16407702, 10.416, 15.537
Mini Moka Sync Cache, 100000, 6, 14693675, 16407702, 10.446, 10.977
Moka Sync Cache, 100000, 1, 14694850, 16407702, 10.439, 13.363
Moka Sync Cache, 100000, 3, 14676093, 16407702, 10.554, 18.943
Moka Sync Cache, 100000, 6, 14681135, 16407702, 10.523, 16.385
Moka Async Cache, 100000, 1, 14694850, 16407702, 10.439, 18.321
Moka Async Cache, 100000, 3, 14676625, 16407702, 10.550, 24.207
Moka Async Cache, 100000, 6, 14671085, 16407702, 10.584, 25.829
Moka SegmentedCache(8), 100000, 1, 14756139, 16407702, 10.066, 14.837
Moka SegmentedCache(8), 100000, 3, 14752150, 16407702, 10.090, 15.109
Moka SegmentedCache(8), 100000, 6, 14754796, 16407702, 10.074, 10.028
Mini Moka Unsync Cache, 400000, 1, 9427202, 16407702, 42.544, 4.603
QuickCache Sync Cache, 400000, 1, 9435796, 16407702, 42.492, 3.406
QuickCache Sync Cache, 400000, 3, 9437025, 16407702, 42.484, 2.144
QuickCache Sync Cache, 400000, 6, 9437357, 16407702, 42.482, 1.316
Foyer In-memory Cache, 400000, 1, 11719257, 16407702, 28.575, 7.818
Foyer In-memory Cache, 400000, 3, 11716211, 16407702, 28.593, 5.892
Foyer In-memory Cache, 400000, 6, 11718895, 16407702, 28.577, 4.480
Mini Moka Sync Cache, 400000, 1, 9427172, 16407702, 42.544, 7.507
Mini Moka Sync Cache, 400000, 3, 9631893, 16407702, 41.297, 10.577
Mini Moka Sync Cache, 400000, 6, 9677616, 16407702, 41.018, 8.505
Moka Sync Cache, 400000, 1, 9439274, 16407702, 42.470, 18.023
Moka Sync Cache, 400000, 3, 9544832, 16407702, 41.827, 17.610
Moka Sync Cache, 400000, 6, 9660525, 16407702, 41.122, 15.473
Moka Async Cache, 400000, 1, 9439274, 16407702, 42.470, 21.929
Moka Async Cache, 400000, 3, 9437912, 16407702, 42.479, 21.970
Moka Async Cache, 400000, 6, 9437062, 16407702, 42.484, 22.803
Moka SegmentedCache(8), 400000, 1, 9459064, 16407702, 42.350, 19.852
Moka SegmentedCache(8), 400000, 3, 9455411, 16407702, 42.372, 15.415
Moka SegmentedCache(8), 400000, 6, 9461712, 16407702, 42.334, 10.762
Mini Moka Unsync Cache, 800000, 1, 4872358, 16407702, 70.304, 4.989
QuickCache Sync Cache, 800000, 1, 5184982, 16407702, 68.399, 4.480
QuickCache Sync Cache, 800000, 3, 5184941, 16407702, 68.399, 2.182
QuickCache Sync Cache, 800000, 6, 5185175, 16407702, 68.398, 1.232
Foyer In-memory Cache, 800000, 1, 5787919, 16407702, 64.724, 6.683
Foyer In-memory Cache, 800000, 3, 5790022, 16407702, 64.712, 4.936
Foyer In-memory Cache, 800000, 6, 5786806, 16407702, 64.731, 3.197
Mini Moka Sync Cache, 800000, 1, 4872358, 16407702, 70.304, 7.500
Mini Moka Sync Cache, 800000, 3, 5330413, 16407702, 67.513, 6.443
Mini Moka Sync Cache, 800000, 6, 5531703, 16407702, 66.286, 5.411
Moka Sync Cache, 800000, 1, 4868066, 16407702, 70.331, 14.032
Moka Sync Cache, 800000, 3, 4931943, 16407702, 69.941, 10.042
Moka Sync Cache, 800000, 6, 5558763, 16407702, 66.121, 8.621
Moka Async Cache, 800000, 1, 4868066, 16407702, 70.331, 16.166
Moka Async Cache, 800000, 3, 4887152, 16407702, 70.214, 13.111
Moka Async Cache, 800000, 6, 4877383, 16407702, 70.274, 14.291
Moka SegmentedCache(8), 800000, 1, 4870652, 16407702, 70.315, 15.438
Moka SegmentedCache(8), 800000, 3, 4869486, 16407702, 70.322, 9.650
Moka SegmentedCache(8), 800000, 6, 4868335, 16407702, 70.329, 6.398

@tatsuya6502
Copy link
Member

tatsuya6502 commented Jun 9, 2024

foyer is a hybrid cache lib and support replaceable caching algorithms in a plug-and-play behavior.

This PR only uses default algorithm (w-TinyLFU) and in-memory cache only. I'm willing to add more configurations if you like place foyer in mokabench. So I make this PR a draft.

Hi @MrCroxx,

Sorry I didn't get back to you sooner. I have been very busy these past few weeks.

Yes, any cache crate are welcomed on mokabench! Please go ahead and add more foyer configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants