re: fread + journaling = slow? [not journaling]
re: fread + journaling = slow? [not journaling]
- Subject: re: fread + journaling = slow? [not journaling]
- From: Paul Carnine <email@hidden>
- Date: Mon, 04 Oct 2004 11:18:35 +0200
Folk:
I spoke too soon.
In fresh light this morning the issue is not related to Journaling.
I am not sure this is the right list any more, because the problem has to do
with using the Finder to do a file-copy or duplicate on a file with a
resource fork. But in the end, it's an fread()/semaphore-in-kernel issue...
Let me know (privately) where you think I should post this (and sorry for
the bandwidth here).
My test file is a 2meg file with a small resource fork.
My test code (posted before) just randomly reads 4096 blocks from the input
file.
My tests:
(I used DiskUtility to do the mounting/unmounting)
Here's the new issue:
> time ./tst /Volumes/Larry/file
4.4s
So, my test is slow now.
> umount /Volumes/Larry (using disk utility)
> mount /Volumes/Larry (using disk utility)
> time ./tst /Volumes/Larry/file1
0.4s
Just unmount, then mount and wham - back up to speed.
Now it gets interesting:
Use "Finder" to do a file copy to file2:
> time ./tst /Volumes/Larry/file2
4.4s
Woah, slow again?!
Now it gets really fun, use "ditto --rsrc" to copy
> ditto --rsrc /Volumes/Larry/file2 /Volumes/Larry/file3
> time ./tst /Volumes/Larry/file3
0.4s
Back up to speed!
The terminal "cp" cmd also "removes" the speed block:
> cp /Volumes/Larry/file2 /Volumes/Larry/file4
> time ./tst /Volumes/Larry/file4
0.4s
And just to be sure I'm not smoking crack, here's the original file, still
slow:
> time ./tst /Volumes/Larry/file2
4.4s
Why does the copied file have different performance than an uncopied file?
But only when copied with the finder?
Now I can go on -- if I do the same test with a file that *has no resource
fork*, then the "Finder copy" leaves the file just as fast.
FWIW, Finder-Duplicate does the same thing.
So it seems to be Finder + RsrcFork = slow access on resulting file.
If you unmount/remount the Volume, then speed is back to "normal".
This is on 10.3.5, volume Larry has journaling off.
It feels to me like the Finder isn't releasing the resource fork and that's
causing some sort of semaphore to kick in (when my test is "slow" all time
is spent in the kernel on semaphores).
"lsof" doesn't show the file being open, but perhaps "lsof" doesn't show
resource forks...
Any ideas what's going on or, more importantly, how I can get around this?
I just want fread() to have good performance...
-pdc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden