Skip to content

Commit

Permalink
fix: improve reliability of cache benches by introducing "fake work"
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Dec 17, 2024
1 parent 11cf700 commit 7d39112
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions caffeine/microbenchmarks/bench_utils.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import time

from frappe.utils.caching import site_cache


@site_cache
def bench_site_cache_no_arg():
time.sleep(0.1)
return 42


@site_cache
def bench_site_cache_many_args(x=4, y="abc", z=1.22):
time.sleep(0.1)
return 42


@site_cache(ttl=600)
def bench_site_cache_with_ttl():
time.sleep(0.1)
return 42

0 comments on commit 7d39112

Please sign in to comment.