Atelier des rouesLab FR
Objects/Documentation

octets22.py

Traced bytes across eight group searches · octets22.py

Download ↓
"""Fresh subprocess per treatment. Trace Python allocations including graph setup."""
from functools import lru_cache
import gc,json,subprocess,sys,tracemalloc
from pathlib import Path
from stables18 import graph


def measure(v,cap,ranks):
    gc.collect();tracemalloc.start()
    adj=graph();mask=((1<<34)-1)&~(1<<v)&~adj[v]
    @lru_cache(maxsize=cap)
    def poly(rem):
        if not rem:return (1,)
        j=max((i for i in range(34) if rem>>i&1),key=lambda i:(rem&adj[i]).bit_count())
        rest=rem^(1<<j);a=poly(rest);b=(0,)+poly(rest&~adj[j])
        return tuple((a[i] if i<len(a) else 0)+(b[i] if i<len(b) else 0) for i in range(max(len(a),len(b))))

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.