Part of the reason there is input lag in both Mastodon and Pinafore is because of the auto-resizing textbox. Believe it or not, there is no way in HTML/CSS to make a <textarea> that automatically expands or contracts to fit the content. (Believe me, I've looked.)
The best solutions are all JavaScript-based, which requires recalculating layout every time a character changes (e.g. you press a key). In Pinafore I mitigate this by syncing layouts to frames, but it's not a perfect solution.