Feature #6902
closedspeed up listing of snapshots if requesting name only and sorting by name
100%
Description
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:
- 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:
- time zfs list -t snapshot -o name -s name > /dev/null
cold cache: 525s
warm cache: 218safter:
- 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
Related issues
Updated by Electric Monk over 7 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 0d8fa8f8eba3ea46bc79d73445009505d1dd5d7d
commit 0d8fa8f8eba3ea46bc79d73445009505d1dd5d7d Author: Martin Matuska <martin@matuska.org> Date: 2016-05-15T14:00:09.000Z 6902 speed up listing of snapshots if requesting name only and sorting by name 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>
Updated by Gernot Strasser over 7 years ago
- Related to Bug #6980: 6902 causes zfs send to break due to 32-bit/64-bit struct mismatch added