# Sling less for speed

- ## while(@row = $sth->fetchrow_array) { … }

  - one field: 3,100 fetches per cpu second
  - ten fields: 1,000 fetches per cpu second

##

- ## while($row = $sth->fetchrow_arrayref) { … }

  - one field: 5,300 fetches per cpu second
  - ten fields: 4,000 fetches per cpu second

##

- ## Notes:

  - Timings made on an old SPARC 10 using DBD::Oracle
  - Timings assume instant record fetch within driver
  - Fields all just one char. @row would be even slower for more/bigger fields
  - Use bind_columns() for direct access to fetched fields without copying

Previous slide | Next slide | Back to first slide | View graphic version