Skip to content

'Linting' for potential inefficiencies #2462

Open
@gfwilliams

Description

In Espruino we have quite a few functions that do multiple things...

eg:

jsvObjectSetChild(obj, "name", child);
jsvUnLock(child);

turns into:

jsvObjectSetChildAndUnLock(obj, "name", child);

Which for something that's used a lot can end up saving an awful lot of flash.

Ideally we should be able to have a list of these, and then run over the code and detect when code exists that uses the first pattern when it should use the second.

We have ... make lst; scripts/find_common_code.js bin/projectname.lst at the moment which looks at the final built code and has helped to detect glaring issues, but this doesn't stop new uses of the old pattern coming in which over time can add up to waste a lot of space.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions