The 4,000 KB figure does not tell you how much work the indicator does on each price update. In MT4, OnCalculate usually runs when a new tick arrives. Even one displayed session can be expensive if the code keeps rebuilding its history or redrawing many objects.
First try the same symbol and timeframe on a clean chart with only this indicator. Compare responsiveness with it removed, then added. If it has a calculation-history or price-step setting, reduce one setting at a time and keep the session unchanged. That separates the indicator from the rest of the template.
With the source, I would check whether unchanged bars are recalculated and whether objects are deleted and recreated on each update. These are checks, not a diagnosis of your file. MQL4 explains the incremental-calculation mechanism here:
https://docs.mql4.com/basis/function/events#oncalculate
Which exact Market Profile version and timeframe are you using, and does removing it immediately restore normal scrolling?