TILOS-AI-Institute / MacroPlacement

Macro Placement - benchmarks, evaluators, and reproducible results from leading methods in open source
BSD 3-Clause "New" or "Revised" License
207 stars 41 forks source link

Simple speedups to FD code? #46

Closed i-markov closed 1 year ago

i-markov commented 1 year ago

Looking into FD code, it seems there are ways to speed it up. First, when defining large constants (such as the map in Flip()), use const where possible, and try to move them out of the functions and into the file scope, so that those constants are initialized once and not upon every function call. If that works, also declare them as static to avoid name clashes. Second, identify short time-critical low-level methods and try to make them inline by moving their bodies next to declarations in .h . Third, make sure there are no string operations in critical methods (everything can be precomputed in advance, stored as integer/double arrays and looked up). Fourth, separate implementations of low-level time-critical non-inlined methods into a separate file. I'd be happy to provide more suggestions at that point.