GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — _remote_debugging: quadratic replay time for RLE records with alternating status · Issue #152721 · python/cpython Closed Closed Copy link Labels extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-profilingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug descriptionThe binary profile reader in
Reproducerimport os, tempfile, time from _remote_debugging import ( FrameInfo, LocationInfo, ThreadInfo, InterpreterInfo, THREAD_STATUS_HAS_GIL, ) from profiling.sampling.binary_collector import BinaryCollector from profiling.sampling.binary_reader import BinaryReader class NullCollector: def collect(self, samples, timestamps): pass def export(self, filename): pass def timed(n): fn = tempfile.mktemp(suffix=".pyb") frame = FrameInfo(("rle.py", LocationInfo((1, 1, 0, 0)), "f", None)) writer = BinaryCollector(fn, 1000, compression="none") for i in range(n): status = THREAD_STATUS_HAS_GIL if i % 2 else 0 interp = InterpreterInfo((0, [ThreadInfo((1, status, [frame]))])) writer.collect([interp], timestamp_us=1000 + i) # same stack -> one repeat record writer.export(None) t0 = time.perf_counter() with BinaryReader(fn) as reader: reader.replay_samples(NullCollector()) os.unlink(fn) return time.perf_counter() - t0 for n in (50_000, 100_000, 200_000): print(n, f"{timed(n):.2f}s") # Doubling n roughly quadruples the time (quadratic). Expected behaviorReplay time should be linear in the number of samples. The list for each Linked PRsReacted by Maurycy Pawłowski-Wieroński Activity
MetadataMetadataAssigneesLabelsextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-profilingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |