I've got the feeling that the particular type of problem demonstrated by my example should be fixable without impacting significantly on performance.
But perhaps I haven't grasped the importance of the longsize check, and a "feeling" isn't a very convincing argument ...