Skip to content

inlining core functionality #275

Description

@grrrr

I have made the discovery that in HvMessage.h there are functions declared as static inline which means we are in C99 land anyway.

On the other hand, it is worthwhile to think of inlining all of the lighter functions in the ir2c/static folder.
I have made a small test and it turned out (to my surprise) that the code for a larger patch became actually smaller, and a tad faster.

Many of the generated functions look like this

void Heavy_crossover::cBinop_qMGYbdCE_sendMessage(HeavyContextInterface *_c, int letIn, const HvMessage *m) {
  cBinop_k_onMessage(_c, NULL, HV_BINOP_DIVIDE, 20.0f, 0, m, &cBinop_ppvFApAF_sendMessage);
}

void Heavy_crossover::cCast_jvNer2OG_sendMessage(HeavyContextInterface *_c, int letIn, const HvMessage *m) {
  cBinop_k_onMessage(_c, NULL, HV_BINOP_GREATER_THAN, 0.0f, 0, m, &cBinop_I4bHe9qQ_sendMessage);
}

which (because of the constants) is clearly heavily optimizable in an inline function.
I think that we can rely on the compilers to optimize for speed or size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions