Skip to content

.mpy files store multiple copies of identifiers #3054

@pfalcon

Description

@pfalcon

There's something wrong with .mpy files: they store the string value of source filename again and again, multiple times:

./lib/time.py.ustruct.unpack
@iiiiiiiii.tuple...tmg.............&G(0((+......7......d.......d.............Q.f.......d...h...d..........d.........X.!...d.[.strftime
./lib/time.py.time.int.array.array.i
localtime_      bytearray       strftime_.str.utf-8...format.tR............)&G(.(......7......d.......d.............f.......d...
...........f.d.[        localtime
./lib/time.py.time.int.ustruct.pack.i
localtime_._c_tm_to_tuple.uctypes.bytearray_at...tR............3&G(.(......7......d.......d.............f.......d...
...........f.d.[.gmtime
./lib/time.py.time.int.ustruct.pack.i.gmtime_._c_tm_to_tuple.uctypes.bytearray_at...t.......            ....=........
...d.d.[.mktime
./lib/time.py.mktime_._tuple_to_c_tm...tt.......        .....A.......d.[.perf_counter
./lib/time.py.time.........     .....D.......d.[.process_time
./lib/time.py.clock..

That certainly doesn't help to save heap size when loading them.

time.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions