Added throttling and debouncing for better performance on viewport updates