Skip to content

Commit 36e743c

Browse files
committed
Did benchmarks for blosc2_getitem_ctx 'supposed' overhead
1 parent f07b60b commit 36e743c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/blosc2/blosc2_ext.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,8 +1908,9 @@ cdef int aux_miniexpr(me_udata *udata, int64_t nchunk, int32_t nblock,
19081908
# Unsafe, but it works for special arrays (e.g. blosc2.ones), and can be fast
19091909
dctx = ndarr.sc.dctx
19101910
else:
1911-
# This can add a significant overhead, but it is needed for thread safety.
1912-
# Perhaps one can create a specific (serial) context just for blosc2_getitem_ctx?
1911+
# This is needed for thread safety, but adds a pretty low overhead (< 400ns on a modern CPU)
1912+
# In the future, perhaps one can create a specific (serial) context just for
1913+
# blosc2_getitem_ctx, but this is probably never going to be necessary.
19131914
dctx = blosc2_create_dctx(BLOSC2_DPARAMS_DEFAULTS)
19141915
if nchunk * ndarr.chunknitems + start + blocknitems > ndarr.nitems:
19151916
blocknitems = ndarr.nitems - (nchunk * ndarr.chunknitems + start)

0 commit comments

Comments
 (0)