R4: Major performance rewrite start