I would say the only way to know for sure is to test, but:
1/ a few thousand lines of code doesn't seem that much, if they run fast
2/ if running these lines is slow, then no matter where they are stored it will still be slow.
A few random thoughts:
Are you loading any data apart from that code, or is all the data coming from that code? Loading big data files can be slower.
Is this code doing some heavy computations, perhaps generating a lot of data that fills memory? Does it run fast on your computer? Is there a way to precompute all that so that you can directly load the data when starting the app? Could caching (of data or plots) help?
Are you testing on your computer within RStudio, or on a server (e.g. shinyapps.io)? Could the server have limitations (of RAM or CPU) that make some computations much sower?
Have you tried using shinyloadtest and profvis to better target the problem?