Using the Allow
and Deny
is probably faster because it doesn't require running a script. The htaccess file will need to be read but as long as it's unchanged, nothing else needs to happen. It would work even faster if you put them in the server/vhost config instead of an htaccess file.
As for allocation blocks, there's several places that you can google: