Disclaimer: you flash these at your own risk. Knox counter will be tripped. Having the stock firmware to hand is also advised.

NOTE: BEFORE MAKING MODIFICATIONS, ON SOME ANDROID 5.1.1/6.0 DEVICES IT IS NECESSARY TO GO TO:Settings -> Developer Options -> OEM unlocking
AND ENABLE OEM UNLOCK FIRST OR YOU MAY ENCOUNTER 'BLOCKED BY FRP LOCK' WHEN FLASHING.

UPDATE 21/11/2017 - Magisk updated to v14
UPDATE 26/10/2016: GUI lag fix - Lag in the GUI should now be fixed
MTP fix - MTP should now be working

To install TWRP:

1. Flash with ODIN 3.10.7 in the AP slot.
Uncheck Auto reboot.

2. Load the respective file below into the AP slot and hit start.

3. After flashing when ODIN says PASS immediately reboot to recovery by holding POWER + HOME + VOL DOWN.
As soon as the screen goes blank change to VOL UP whilst still holding the other buttons.
You should now see TWRP recovery.

2 . Flash the PRE-ROOTED boot image below with ODIN(AP slot) or TWRP(extract boot.img first from tar file). Current version is [SR1-SuperSU-v2.78-SR1-20160915123031].supersu_2.78_SR1_systemless_boot_t280

interesting, what caused the lag to happen? I initially suspected it to be gpu clock throttling but didn't have time to figure it out

Hi Jed, after trying various different configs in twrp and even modifying the graphics source code it made no difference.
Using the the touch debugger in twrp it was apparent that the touch was responding fine.

So I turned my attention to the kernel.
After several builds of modifying the cpu config making no difference, it turns out TWRP only supports double buffering, but the kernel was forcing triple buffering.
It seems this was causing an extra frame to be displayed causing what seemed like lag and explains why when pressing the screen a second time would cause the frame to update.

The page that was in ram had changed when tapping a button, but the wrong frame in the buffer was displayed until the next touch which then updated the display.

Disclaimer: you flash these at your own risk. Knox counter will be tripped. Having the stock firmware to hand is also advised.

NOTE: BEFORE MAKING MODIFICATIONS, ON SOME ANDROID 5.1.1/6.0 DEVICES IT IS NECESSARY TO GO TO:Settings -> Developer Options -> OEM unlocking
AND ENABLE OEM UNLOCK FIRST OR YOU MAY ENCOUNTER 'BLOCKED BY FRP LOCK' WHEN FLASHING.

UPDATE 26/10/2016: GUI lag fix - Lag in the GUI should now be fixed
MTP fix - MTP should now be working

To install TWRP:

1. Flash with ODIN 3.10.7 in the AP slot.
Uncheck Auto reboot.

2. Load the respective file below into the AP slot and hit start.

3. After flashing when ODIN says PASS immediately reboot to recovery by holding POWER + HOME + VOL DOWN.
As soon as the screen goes blank change to VOL UP whilst still holding the other buttons.
You should now see TWRP recovery.

2 . Flash the PRE-ROOTED boot image below with ODIN(AP slot) or TWRP(extract boot.img first from tar file). Current version is [SR1-SuperSU-v2.78-SR1-20160915123031].supersu_2.78_SR1_systemless_boot_t280

XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality.Are you a developer? | Terms of Service