clang-randstruct / llvm-project

Randomize the order of fields in a structure layout as a compile-time hardening feature
3 stars 1 forks source link

Performance Mode #3

Closed tim-pugh closed 5 years ago

tim-pugh commented 5 years ago

We will require multiple approaches for randomization. To meet one of our project goals, we'll need a performance mode that will require a different algorithm for re-arranging the fields with respect to cache lines.

connorkuehl commented 5 years ago

We've discussed a couple of possible approaches.

Today, just as a fun first step to an MVP, we've simply shuffled the order of the fields.

Moving forward, we could:

Approach 1:

  1. Shuffle the order of the fields

  2. Iterate through the new order, adding fields into buckets such that each bucket is the size of a cache line (except for any left-out remainders)

  3. We can then shuffle the order of the buckets (or leave them alone?)

We'll write down any other approaches here.

connorkuehl commented 5 years ago

First iteration exists and is closed by #17