HomeFreeBSD

6902 speed up listing of snapshots if requesting name only and sorting by name

Description

6902 speed up listing of snapshots if requesting name only and sorting by name

illumos/illumos-gate@0d8fa8f8eba3ea46bc79d73445009505d1dd5d7d
https://github.com/illumos/illumos-gate/commit/0d8fa8f8eba3ea46bc79d73445009505d1dd5d7d

https://www.illumos.org/issues/6902

pjd has authored and commited a patch in Jan 21, 2012 that substanially speeds
up zfs snapshot listing if requesting only the name property and sorting by
name.
In this special case, the snapshot properties do not need to be loaded. This
code has been adopted by zfsonlinux on May 29, 2012.
Commit message from pjd:
     Dramatically optimize listing snapshots when user requests only
     snapshot
     names and wants to sort them by name, ie. when executes:
        1. zfs list -t snapshot -o name -s name
     Because only name is needed we don't have to read all snapshot
     properties.
     Below you can find how long does it take to list 34509 snapshots from
     a single
     disk pool before and after this change with cold and warm cache:
     before:
        1. time zfs list -t snapshot -o name -s name > /dev/null
           cold cache: 525s
           warm cache: 218s
     after:
        1. time zfs list -t snapshot -o name -s name > /dev/null
           cold cache: 1.7s
           warm cache: 1.1s
References:
http://svnweb.freebsd.org/base?view=revision&revision=230438
https://github.com/freebsd/freebsd/commit/8e3e9863
https://github.com/zfsonlinux/zfs/commit/0cee2406

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pawel Dawidek <pjd@freebsd.org>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Martin Matuska <martin@matuska.org>

Details

Provenance
avgAuthored on
Reviewer
matthew
Parents
rS302642: 6876 Stack corruption after importing a pool with a too-long name
Branches
Unknown
Tags
Unknown