As the number of records increases, the time required for the browser to render them increases. Paging is used to reduce the amount of data exchanged with the client. Paging is typically handled on the server side (standardsetcontroller). The page sends parameters to the controller, which the controller needs to interpret and then respond with the appropriate data set.
Using the above controller methods we can define the pagination.
Do you really feel the code is little larger then what you expect, here is the minified version of controller and page