Pyベンチ実測MEASURED, NOT RECALLED

    ↑↓ to select, Enter to open, Esc to close

    Findings

    All 13 survived three independent runs with the same direction and magnitude.

    例外で分岐 is ~4.11× slower than in で判定4.11× · CV 1.7%json.dumps is ~2.62× slower than pickle.dumps2.62× · CV 3.2%deepcopy is ~37.04× slower than copy(浅い)37.04× · CV 0.9%% 書式 is ~1.75× slower than f-string1.75× · CV 3.2%正規表現 is ~2.33× slower than startswith2.33× · CV 3.5%index 参照 is ~1.54× slower than 直接イテレート1.54× · CV 1.2%sum(list(range(n))) is ~1.78× slower than sum(range(n))1.78× · CV 3.6%deepcopy is ~1.62× slower than JSON ラウンドトリップ1.62× · CV 0.9%dict.fromkeys is ~1.49× slower than set() で重複除去1.49× · CV 3.4%enumerate is ~1.45× slower than range(len())1.45× · CV 2.6%dict の参照 is ~1.12× slower than __slots__ 属性1.12× · CV 0.4%append ループ is ~1.11× slower than リスト内包表記1.11× · CV 0.3%sorted() で新リスト is ~1.06× slower than list.sort() インプレース1.06× · CV 3.5%