Ok, a quick example of the differences I'm seeing in an everyday task: At dinner a silly question came up of how many times the word "nazi" shows up in my e-mails. So, instead of approaching it hypothetically, I whipped out a terminal on my Hardy box and typed grep -Ri nazi Mail | wc -l.
Then I remembered I still have a BSD VM set up on the same box, so why not give that a try too? So I SSH'ed into the FreeBSD VM and typed the same thing. Given virtualization overhead, I expected certainly that Ubuntu would respond first with my answer. To my surprise, FreeBSD finished first, by a considerable margin! Shocked at this result, I attempted to time both of them with the time command, taking 5 samples and reporting the minimum. Here's the best runs:
Code:
# FreeBSD 7-STABLE
[jdong@wormhole ~]$ time grep -Ri nazi Mail | wc -l
grep: warning: Mail/.Inbox: recursive directory loop
315
real 1m17.137s
user 0m3.779s
sys 0m14.692s
# Hardy
[jdong@jdong:~]$ time grep -Ri nazi Mail | wc -l (04-22 20:55)
grep: warning: Mail/.Inbox: recursive directory loop
315
grep -Ri nazi Mail 184.98s user 7.61s system 81% cpu 3:57.66 total
wc -l 0.00s user 0.00s system 0% cpu 3:57.66 tota
Ubuntu took over two times longer and yielded the same result. Now I understand that FreeBSD has a different grep implementation than Linux, but frankly I don't care for this purpose -- I wanted to know how many times a word shows up in my e-mail and FreeBSD answered that question first. Even inside a VM with only 128MB RAM while Ubuntu had the rest of the 2GB RAM native.
Now this is a very limited example microbenchmark, but it definitely contributes to the general gut feeling I have that FreeBSD is "snappier"
UPDATE:
If that's not sick enough, I decided to test multitasking: In simultaneous SSH sessions I issued a grep command each against the same directory but for different words, simulating multitasking workloads on similar datasets (which I expect the CPU and IO schedulers to have some leeway in optimizing). Pasted are the results one after another, but understand that they ran in parallel on the actual test:
Code:
#FreeBSD
[jdong@wormhole ~]$ time grep -Ri nazi Mail | wc -l
grep: warning: Mail/.Inbox: recursive directory loop
315
real 1m22.114s
user 0m4.693s
sys 0m10.446s
[jdong@wormhole ~]$ time grep -Ri jdong Mail | wc -l
grep: warning: Mail/.Inbox: recursive directory loop
58094
real 1m21.615s
user 0m2.879s
sys 0m9.935s
#Linux
[jdong@jdong:~]$ time grep -Ri nazi Mail | wc -l (04-22 21:03)
grep: warning: Mail/.Inbox: recursive directory loop
315
grep -Ri nazi Mail 173.90s user 4.47s system 70% cpu 4:11.32 total
wc -l 0.00s user 0.00s system 0% cpu 4:11.32 total
[jdong@jdong:~]$ time grep -Ri jdong Mail | wc -l (04-22 20:59)
grep: warning: Mail/.Inbox: recursive directory loop
58191
grep -Ri jdong Mail 171.29s user 6.02s system 70% cpu 4:10.44 total
wc -l 0.01s user 0.02s system 0% cpu 4:10.44 total
Even though FreeBSD only had one virtualized core while Ubuntu was allowed both CPU cores (and used both cores fully throughout the test), FreeBSD was able to service the requests faster than Ubuntu.
Note also that the average grep time from single to multi threaded for FreeBSD increased from 1:17->1:22 while for Linux increased from 3:57 to 4:11... The latter result doesn't make sense to me because FreeBSD barely suffered a hit even though it was limited to one core while Ubuntu used both cores but suffered a bigger proportional hit!
Bookmarks