Page MenuHomeSoftware Heritage

Explicitely implement from_dict instead of using introspection magic.
ClosedPublic

Authored by vlorentz on Thu, May 9, 4:30 PM.

Details

Summary

There is more repetition, but it's easier to read and
'%timeit Revision.from_dict(d)' is 5 times faster.

Diff Detail

Repository
rDMOD Data Model
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz created this revision.Thu, May 9, 4:30 PM
douardda requested changes to this revision.Fri, May 10, 10:23 AM
douardda added a subscriber: douardda.

I agree it's easier to read, so LGTM (just a small refactoring and I'm ok with this)

swh/model/model.py
311

should be the right time to rewrite this using a list comprehension IMHO

This revision now requires changes to proceed.Fri, May 10, 10:23 AM
vlorentz updated this revision to Diff 4767.Fri, May 10, 10:26 AM

list comp

douardda accepted this revision.Fri, May 10, 10:26 AM
This revision is now accepted and ready to land.Fri, May 10, 10:26 AM
This revision was automatically updated to reflect the committed changes.