Skip to content

Abysmal performance of the HEX record serialization #37

Description

@Code7R

Hello,

see attached example. Nothing spectacular, it basically writes out 128MB of raw data.

Expected result: be done in a couple of seconds.

Observed result: roughly 50 seconds for hexrec.SrecFile and 43 seconds for IhexFile. Also consuming over TREE Gig of RAM (on amd64 system with Python 3.13).

Stack trace on random locations shows it typically lurking around here:

cast, typing.py:2391
compute_checksum, ihex.py:187
validate, base.py:1386
validate, ihex.py:405
init, base.py:799
create_data, ihex.py:211
update_records, ihex.py:709
records, base.py:3554
serialize, base.py:3694
save, base.py:3603
, perf.py:7

perf.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions