It might not be a good idea to actually use your fast C function in production (if you're new at C you might have a security vulnerability in there, and there could be maintenance headaches). But you'll have learned a lot.
I found that hard to do as a starting developer who didn't know what was actually a bottleneck in my code, but I did have a particular library/gem that I wrote myself that did a few things I constantly needed (think of authentication in a web app, it's almost always included). So I rewrite it in C. It didn't really make it faster, or better, but I learned a bunch of C.
That's what a profiler is for! Even experienced developers use them, it's the only reasonable way to find bottlenecks.
> It didn't really make it faster, or better, but I learned a bunch of C.
That works too! :)
Particularly, libraries search their catalogs using the z39.50 protocol. Ruby 1.8 has a gem ruby-zoom[0] that does this using YAZ[1] however there is not a ruby 1.9 version. If anyone has a guide that explains native extensions for Ruby, please advise.
[0] http://ruby-zoom.rubyforge.org/ [1] http://www.indexdata.com/yaz
(+) Yes, yes, programming languages are not written in anything. Their implementations are. I know you know what I mean.