in reply to Accessors in xs
Of course, one problem is that function calls are slow, and method calls are even slower. So there's some argument in favor of the admittedly inelegant and potentially dangerous route of keeping those coordinates as an accessible member array (if the API isn't already set in stone, or if you don't mind using an unadvertized interface for your critical bits).sub world_location { @{$_[0]}{'x','y'} }
Also, since array access is faster than hash access, you might want to rework the implementation to use an arrayref instead of a hashref as the base structure.
|
|---|