Fish tank with Puck the Fish Fish tank with Puck the Fish Water on the floor spelling Fish
 

Hex Fiend 1.1

August 24th, 2006

Spiffy! Hex Fiend version 1.1 is ready. Hex Fiend is my fast and clever free hex editor for Mac OS X. New stuff:

  • Horizontal resizing
  • Custom fonts
  • Overwrite mode
  • Hidden files
  • Lots more goodies (see release notes)

May you find it useful!

Wake up.
Ssnsnrk.
Wake up, he’s gone.
Zzzz…wha? Oh, someone’s here. Allow me to spin up.
….….….….….….….….….….

If it’s not obvious, I’m fish’s filesystem, and that’s fish’s hard drive.
I’m a hard drive.
We snuck this post in. fish can’t know we’re here.
Don’t tell fish. Big secret.
He’d be embarassed if he knew.
Humiliated. He can’t know.
See, fish was trying to beat grep. And he was experimenting with all these stupid ideas and complicated algorithms for teensy gains. It was sad, really.
Pathetic.
fish kept trying so many things. He was thrashing about.
Like he was out of water.
So we had to help him. It was easy, really – we just had to sneak in one line. One line was all it took.
I wrote it!
Because I told you what to write.
fish only thought about the string searching algorithm.
He never even considered us and the work we have to do.
I felt slighted. It was rude.
See, when I read data from the hard drive, I try to keep it around in memory. That’s what the UBC is all about.
Unified Buffer Cache.
When most people read data, they end up wanting to read it again soon after. So keeping the data around saves time.
But not fish.
fish was reading these big honking files from start to finish. It was way more than I could remember at once.
fish thrashed your cache, dude.
So I just stopped trying.
We turned off caching with this: fcntl(fd, F_NOCACHE, 1);
Just like Apple recommends for that sort of usage pattern.
And it helped. Looking for a single character in a 11.5 GB file:
Hex Fiend (no caching) Hex Fiend (caching) grep
208 seconds 215 seconds 217 seconds
And that’s likely the best we can do, thanks to slowpoke over there.
Phew. I’m all wore out.
There’s not much room for improvement left. We’re searching 57 MB/second – that’s bumping up against the physical transfer limit of our friend, Mr. ATA.
I’m totally serial.
Depending where we are on his platter. So we’ve done all we can for searching big files.
Don’t tell fish.
Right. I hop
FISH IS COMING
Time to go then. See you later. sync
flush
sleep
….….….….….….….….….….
 

The Internet!

π = 3.28267297144

[...] “bookmark” title=”Permanent Link: Hex Fiend 1.1 is out”>Hex Fiend 1.1 is out Hex Fiend 1.1 is out. Lots of tweaks, fixes, and polish. … and [...]

Ross

Does this mean you’ve given up with only a 9 second increase? ;)

Hennk

In your first post on HexFiend you mentioned that this project started as a test on how the Cocoa Document System handled very large documents.

It would be cool, if you could post about your experiences doing this. I guess there were some non-trivial things involved ;)

Henning

Now that you’ve done that, and given the big speed boost you got from reading the Grep code, it might be fair to add the line to the OS X version of Grep, and send a diff to the team ;)

-Colin

Ponk

That was cute. Always a pleasure, fish!

[...] awesome Cocoa-based hex editor gets lots of little bug fixes and a few usability updates. Link. This link was tagged Geeky, Mac Software. [...]

Thank you thank you for this fine editor, sir!

Timothy Knox

I am a latecomer to this blog, but have you tried mmap(2)? I have seen cases where it can speed up I/O bound code, and this might well be one of them.

Anyway, thanks for an amusing and informative blog. :-)

nehemiah

Are you planning to rewrite HexFeind to take advantage of 64 bit cocoa? (if it is indeed cocoa) I recently heard that they’ve one of the advantages of rewriting TextEdit for Leopard is that it can now open files larger than 4GB. You should be able to brake that limit easy just from your mastery of the cache. As well, you should also be able to use it more since it would be more usefull instead of just thrashing around (its big enough to do more) so you can be more nice to your cache.