Skip to content

Instantly share code, notes, and snippets.

@crusaderky
crusaderky / unravel_pickle.py
Created April 4, 2024 23:47
unravel_pickle
from pickle import PickleBuffer
def unravel_pickle(obj: object, seen: list[int] | None = None) -> Any:
if isinstance(obj, (int, float, complex, bytes, str, bool, type(None))):
return obj
if isinstance(obj, (bytearray, memoryview, PickleBuffer)):
return str(type(obj)), bytes(obj)
if callable(obj):
@crusaderky
crusaderky / tcp_bench.ipynb
Created November 1, 2023 13:57
dask/distributed#8318 - Speed up network transfer of small buffers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crusaderky
crusaderky / DemoDay.ipynb
Created June 19, 2023 08:52
Dask Demo Day: Fine performance metrics and spans
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crusaderky
crusaderky / Fine performance metrics demo.ipynb
Created March 3, 2023 16:36
Fine performance metrics demo (distributed#7586)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crusaderky
crusaderky / ActiveMemoryManager_DEMO.ipynb
Created July 28, 2021 18:44
ActiveMemoryManager Demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import sys
from ctypes import POINTER, py_object, Structure, c_ssize_t, c_void_p, sizeof
from typing import Any, Iterator, Optional, Sequence, Union
__all__ = ("OpStack", )
class Frame(Structure):
_fields_ = (