Smartphone laggy and slow: when a factory reset is ineffective First of all, I would like to say that I recognize how tiring it must be to read about people asking for help to solve problems all the time. I tried to not be that person... but here goes my story.
I have  Galaxy S6 (SM-G920i), 4.5 years old, that I used a lot, and always served me well (within its capabilities). It is running Samsung's stock Android 8.1.
However, two days ago, out of nowhere, he became excessively slow. It was very sudden: in a second I was reading some messages on WhatsApp, and in the next second the device was not responding, taking many seconds to answer any command from me.
I decided to restart it. But even that I couldn't. It was as if it didn't recognize that I was hitting the screen lock button. Then I forced a shutdown (I connected it to the charger, and held the power off + volume key).
After that, I turned it on again, but now the phone was stuck in the boot loop: taking 5 or 6 minutes to boot (screen with the Samsung logo) and as soon as it went to the lock screen, it restarted on its own.
I did a search on some specialized sites and forums, and the first recommendation was to &quot;Wipe Cache&quot; through the recovery mode. I was able to enter recovery mode, but I received the message &quot;NO COMMAND&quot; on a blue screen with the green android! Moments later, while I was searching about that new and unexpected error, the recovery screen finally appeared. I selected the option to clear the cache (Wipe Cache Partition), waited for completion, and then restarted the device... No success there! The problem persisted. Bootloop again.
The next recommended step now was to perform a factory reset. Against my will, I did. But, unfortunately, it did not solve the problem: the smartphone is still very slow, it is taking several minutes to boot up, it is taking 3 or 4 seconds to respond to simple commands (lock, unlock, scroll, etc...) and is exaggeratedly slow to open any application (simple as it may be, such as a calculator). Sometimes it hangs and gets hot (e.g. if I try to open the camera). Even in the safe mode, it behaves this way.
I am aware that this problem may be something related to the hardware since the storage units have a life cycle (although unlikely, it is possible that this occurred in less than 5 years). That said, I am also aware that the problem may not have a solution.
On the other hand, hope dies last: have you guys ever seen something similar, even on other devices? Am I missing something? Is there a path that I have not explored? Is it (soft or hard) bricked? Or, considering the facts, it is indeed a dying device?
Thank you for your time!
TL;DR: A Samsung Galaxy S6 with 4.5 years of use suddenly became laggy and unresponsive. &quot;Wipe cache partition&quot; and &quot;Factory reset&quot; were unable to restore device performance. Is there a solution?
I am passing by to post a possible solution to those who have similar issues.
Although I cannot say it is definitive/long-term (I did it only yesterday) the device is really much more responsive now, and the hangings and crashes seemed to disappear.
The steps were (without deep details):
In my computer:

Downloaded a stock ROM from a reliable source (mind the exact version);
Downloaded Odin v3.13;
Installed Samsung USB drivers;

In my Samsung S6:

Wipe Cache (recover mode), then reboot.
Started it in Download Mode.

After that, plug the USB cable between the phone and the PC, and flash the firmware using Odin.
I followed these steps. It may help someone too: https://www.youtube.com/watch?v=UEnm5TU5KMw
In my case, I needed a factory reset after the flashing because the new FW did not erase the data. Now everything seems fine. I wish I had discovered that before buying a new smartphone. However, no problem... I'll give this one to my father. :-)
Hope someone finds this useful.
See you guys!