@@ -270,6 +270,76 @@ E.g., pickle/unpickle an local store array::
270
270
>>> np.all(z1[:] == z2[:])
271
271
np.True_
272
272
273
+ .. _user-guide-uvloop :
274
+
275
+ Event loop optimization with uvloop
276
+ -----------------------------------
277
+
278
+ Zarr can optionally use `uvloop <https://github.com/MagicStack/uvloop >`_, a fast,
279
+ drop-in replacement for the default Python asyncio event loop implementation.
280
+ uvloop is written in Cython and built on top of libuv, providing significantly
281
+ better performance for I/O-intensive operations.
282
+
283
+ When uvloop is available, Zarr will use it by default for better performance.
284
+ This is particularly beneficial when working with remote storage backends or
285
+ performing many concurrent operations.
286
+
287
+ Installation
288
+ ~~~~~~~~~~~~
289
+
290
+ To enable uvloop support, install it as an optional dependency::
291
+
292
+ pip install 'zarr[uvloop]'
293
+
294
+ Or install uvloop directly::
295
+
296
+ pip install uvloop
297
+
298
+ Configuration
299
+ ~~~~~~~~~~~~~
300
+
301
+ uvloop usage can be controlled via Zarr's configuration system:
302
+
303
+ .. code-block :: python
304
+
305
+ import zarr
306
+
307
+ # Enable uvloop (default when available)
308
+ zarr.config.set({" async.use_uvloop" : True })
309
+
310
+ # Disable uvloop (use standard asyncio)
311
+ zarr.config.set({" async.use_uvloop" : False })
312
+
313
+ You can also control this via environment variables::
314
+
315
+ # Disable uvloop
316
+ export ZARR_ASYNC__USE_UVLOOP=false
317
+
318
+ Platform Support
319
+ ~~~~~~~~~~~~~~~~~
320
+
321
+ uvloop is supported on:
322
+
323
+ - Linux
324
+ - macOS
325
+ - Other Unix-like systems
326
+
327
+ uvloop is **not ** supported on Windows. On Windows, Zarr will automatically
328
+ fall back to the standard asyncio event loop regardless of the configuration setting.
329
+
330
+ Performance Benefits
331
+ ~~~~~~~~~~~~~~~~~~~~
332
+
333
+ uvloop can provide performance improvements for:
334
+
335
+ - Remote storage operations (S3, GCS, etc.)
336
+ - Concurrent array operations
337
+ - Large numbers of small I/O operations
338
+ - Network-bound workloads
339
+
340
+ The performance improvement varies depending on the workload, but can be
341
+ substantial for I/O-intensive operations.
342
+
273
343
.. _user-guide-tips-blosc :
274
344
275
345
Configuring Blosc
0 commit comments