Skip to content

Crusade against string lookup #2050

Closed
Closed
@karkhaz

Description

@karkhaz

We have plenty of this sort of thing:

for(extremely_tight_performance_critical_loop)
{
  unsigned max_depth=options.get_unsigned_int_option("depth");
}

depth doesn't ever change, there's no need to look it up in a table every time we do a symex step. I recommend that we find these things, and replace them with

class symext
{
public:
  symext(const optionst &options)
  : depth(options.get_unsigned_int_option("depth"))
  {
  }
protected:
  const unsigned depth;
}

even if the option isn't constant, we can still have it as a member variable (although options that change through the life of the program are somewhat questionable...). Having a member variable means we don't do table lookups, and having the member const additionally means that the branch predictor has a happier time (for boolean members).

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