Skip to content

Commit d107da4

Browse files
committed
comment
1 parent d86babe commit d107da4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Tracing/Cache/TraceableCacheAdapterTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ private function traceGet(string $key, callable $callback, ?float $beta = null,
315315
*/
316316
public static function getCacheItemSize($value): ?int
317317
{
318+
// We only gather the payload size for strings since this is easy to figure out
319+
// and has basically no overhead.
320+
// Getting the size of objects would be more complex, and it would potentially
321+
// introduce more overhead since we don't get the size from the current framework abstraction.
318322
if (\is_string($value)) {
319323
return \strlen($value);
320324
}

0 commit comments

Comments
 (0)