Performance issues
When trying to use rmsbolt on any real code it takes a very long time to get any output, compared to godbolt. I actually found it hard to come up with a stand-alone real world example (that didn't require various includes that I have locally), but I came up with the following.
What I did was (mostly) took rtag's String.h and replaced the rct/List.h include with the actual List.h file. You can see that godbolt takes about 10 seconds to produce the output, while rmsbolt takes about 3 minutes on my machine (note that this is with -O3
optimization). When I don't use optimization it's quite faster.
This is the relevant part from the profiler report I got from emacs (when it takes 3 minutes when using -O3
):
- compilation-sentinel 1727856 52%
- compilation-handle-exit 1727856 52%
- run-hook-with-args 1727797 52%
- rmsbolt--handle-finish-compile 1727745 52%
- rmsbolt--process-asm-lines 1724581 52%
- rmsbolt--process-src-asm-lines 1721272 52%
- cl-find 478908 14%
- apply 478703 14%
- cl-position 477460 14%
cl--position 55234 1%
+ rmsbolt--find-used-labels 27837 0%
+ file-equal-p 7414 0%
+ rmsbolt--has-opcode-p 99 0%
split-string 1871 0%
+ asm-mode 121 0%
+ insert-file-contents 115 0%
erase-buffer 20 0%
+ rmsbolt-move-overlays 13 0%
ws-butler-after-change 2 0%
jit-lock-after-change 2 0%
+ #<compiled 0x39afc69> 2 0%
generate-new-buffer 1 0%
replace-regexp-in-string 1 0%