So I'd like to add a little something here... iXsystems is currently tracking a potential bug in FreeBSD causing poor performance with directory listings. I'm working with a few people to hopefully narrow down the issue. I don't want to say too much because I don't know how much I should (or shouldn't) say and I don't want to provide inaccurate information. But one person seems to have noticed it
https://forums.freenas.org/index.php?threads/performance-9-3-vs-9-10-folder-browsing.50744/
If the information I have is correct, the issue potentially exists on all systems running FreeBSD 10.3+ (potentially earlier 10 releases, but as the first FreeNAS 9.10 was based on 10.3, we don't really care if it happens on FreeBSD 10.2 or not). I heard from someone that the current builds of FreeNAS 10 has this issue as well.
The fixes in this thread do NOT mitigate effectively the bug that we're potentially tracking, nor do I have an ETA.
I don't seem to have directory listings that are big enough to have this issue on my server, and we've had a hell of a time trying to reproduce the issue, but someone was able to reproduce it over the weekend. ;)
So if you're directory listings are slow, you should definitely try upgrading to future releases as I hope they will be fixed.
I'll try to update this thread when we have a fix as this is hitting quite a few people.