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 5 commits 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.

@MrCroxx
Copy link
Author

MrCroxx commented Apr 27, 2024

Here is a benchmark result with the example bench config:

Cache, Max Capacity, Clients, Inserts, Reads, Hit Ratio, Duration Secs
Mini Moka Unsync Cache, 100000, 1, 14695344, 16407702, 10.436, 3.411
QuickCache Sync Cache, 100000, 1, 14300798, 16407702, 12.841, 1.995
QuickCache Sync Cache, 100000, 3, 14300820, 16407702, 12.841, 2.415
QuickCache Sync Cache, 100000, 6, 14300938, 16407702, 12.840, 1.584
Foyer In-memory Cache, 100000, 1, 14859186, 16407702, 9.438, 3.723
Foyer In-memory Cache, 100000, 3, 14860306, 16407702, 9.431, 5.922
Foyer In-memory Cache, 100000, 6, 14858929, 16407702, 9.439, 3.977
Mini Moka Sync Cache, 100000, 1, 14695340, 16407702, 10.436, 7.135
Mini Moka Sync Cache, 100000, 3, 14678474, 16407702, 10.539, 14.216
Mini Moka Sync Cache, 100000, 6, 14691863, 16407702, 10.458, 11.774
Moka Sync Cache, 100000, 1, 14694850, 16407702, 10.439, 12.719
Moka Sync Cache, 100000, 3, 14672336, 16407702, 10.577, 19.035
Moka Sync Cache, 100000, 6, 14696788, 16407702, 10.428, 16.525
Moka Async Cache, 100000, 1, 14694850, 16407702, 10.439, 16.386
Moka Async Cache, 100000, 3, 14674515, 16407702, 10.563, 19.885
Moka Async Cache, 100000, 6, 14674294, 16407702, 10.565, 14.461
Moka SegmentedCache(8), 100000, 1, 14756139, 16407702, 10.066, 13.610
Moka SegmentedCache(8), 100000, 3, 14753336, 16407702, 10.083, 13.968
Moka SegmentedCache(8), 100000, 6, 14748757, 16407702, 10.111, 9.412
Mini Moka Unsync Cache, 400000, 1, 9427202, 16407702, 42.544, 4.692
QuickCache Sync Cache, 400000, 1, 9435796, 16407702, 42.492, 3.276
QuickCache Sync Cache, 400000, 3, 9436652, 16407702, 42.486, 2.233
QuickCache Sync Cache, 400000, 6, 9436101, 16407702, 42.490, 1.352
Foyer In-memory Cache, 400000, 1, 11716425, 16407702, 28.592, 6.283
Foyer In-memory Cache, 400000, 3, 11717557, 16407702, 28.585, 5.449
Foyer In-memory Cache, 400000, 6, 11718131, 16407702, 28.582, 3.207
Mini Moka Sync Cache, 400000, 1, 9427172, 16407702, 42.544, 7.800
Mini Moka Sync Cache, 400000, 3, 9642408, 16407702, 41.232, 9.863
Mini Moka Sync Cache, 400000, 6, 9673816, 16407702, 41.041, 8.586
Moka Sync Cache, 400000, 1, 9439274, 16407702, 42.470, 18.562
Moka Sync Cache, 400000, 3, 9546722, 16407702, 41.816, 16.356
Moka Sync Cache, 400000, 6, 9682573, 16407702, 40.988, 16.105
Moka Async Cache, 400000, 1, 9439274, 16407702, 42.470, 21.803
Moka Async Cache, 400000, 3, 9437628, 16407702, 42.481, 22.907
Moka Async Cache, 400000, 6, 9577208, 16407702, 41.630, 14.978
Moka SegmentedCache(8), 400000, 1, 9459064, 16407702, 42.350, 20.636
Moka SegmentedCache(8), 400000, 3, 9462428, 16407702, 42.329, 15.005
Moka SegmentedCache(8), 400000, 6, 9458327, 16407702, 42.354, 10.203
Mini Moka Unsync Cache, 800000, 1, 4872358, 16407702, 70.304, 5.231
QuickCache Sync Cache, 800000, 1, 5184982, 16407702, 68.399, 4.514
QuickCache Sync Cache, 800000, 3, 5184981, 16407702, 68.399, 2.166
QuickCache Sync Cache, 800000, 6, 5185390, 16407702, 68.397, 1.226
Foyer In-memory Cache, 800000, 1, 5787279, 16407702, 64.728, 5.759
Foyer In-memory Cache, 800000, 3, 5785352, 16407702, 64.740, 3.546
Foyer In-memory Cache, 800000, 6, 5786223, 16407702, 64.735, 2.229
Mini Moka Sync Cache, 800000, 1, 4872358, 16407702, 70.304, 7.818
Mini Moka Sync Cache, 800000, 3, 5224369, 16407702, 68.159, 6.422
Mini Moka Sync Cache, 800000, 6, 5566639, 16407702, 66.073, 5.440
Moka Sync Cache, 800000, 1, 4868066, 16407702, 70.331, 15.001
Moka Sync Cache, 800000, 3, 5073738, 16407702, 69.077, 10.311
Moka Sync Cache, 800000, 6, 5559273, 16407702, 66.118, 8.869
Moka Async Cache, 800000, 1, 4868066, 16407702, 70.331, 17.189
Moka Async Cache, 800000, 3, 4875971, 16407702, 70.282, 14.924
Moka Async Cache, 800000, 6, 5188895, 16407702, 68.375, 9.283
Moka SegmentedCache(8), 800000, 1, 4870652, 16407702, 70.315, 16.572
Moka SegmentedCache(8), 800000, 3, 4879565, 16407702, 70.261, 10.072
Moka SegmentedCache(8), 800000, 6, 4868015, 16407702, 70.331, 6.578

@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.

2 participants