Skip to content

Instantly share code, notes, and snippets.

@ArtemGr
ArtemGr / bench_init.py
Last active August 30, 2026 05:48 — forked from jcrist/bench_init.py
A benchmark comparing init performance of various dataclass-like libraries
"""A quick benchmark comparing default and explicit-value initialization for
various dataclass-like libraries.
We also compare against the time it takes to initialize a `dict` or `tuple`
with the same data, as a "low-bar" for pure-python implementations.
These are not semantically identical operations: notably, Pydantic validates
and may coerce supplied values while the other constructors generally assign them.
"""
@ArtemGr
ArtemGr / .gitignore
Last active February 6, 2022 11:24 — forked from mfelsche/sled_experiment.rs
Rocksdb experiment, watching consumed disk space
/target
/db
/Cargo.lock
#![feature(scoped_tls)]
#[macro_use] extern crate nickel;
use nickel::Nickel;
use nickel::router::http_router::HttpRouter;
use nickel::ResponseFinalizer;
struct MyObject;
impl MyObject {