riptl / wii-symbols

Debug symbols for Wii games
10 stars 2 forks source link

match_symbols very slow #1

Open riptl opened 4 years ago

riptl commented 4 years ago

Currently, match_symbols searches the entire MEM1 dump (24MB) for each symbol using regex, which is very CPU intensive and takes a few minutes. That adds up to 240 GB of memory reads for 10000 symbols.

There is a lot of optimization possible. For example, the search function could assemble a finite state machine from all symbols (with relocation masks) and then go through MEM1 in one go (with back-tracking).

But for now, I would rather wait for the slow algorithm to finish up than invest time to write a faster algorithm. Contributions welcome.