Skip to content

Instantly share code, notes, and snippets.

@alechko
alechko / drupal_cache_bench.php
Last active December 17, 2015 20:48
drupal cache benchmark sample
<?
# intended to execute in "devel execute php"
# to use outside devel, replace dsm() with print()
#
# this piece will measure cache set /get time for any method implemented in drupal.
# by default, it'll be the database caching, and you will be able to see the table
# 'cache' filling with entries.
# I'm using this to measure the difference of the default db method vs memcached.
# So for the first run, I use no extra cache config / modules, and I'm executing
# snippet 3 times.