Hacker News new | ask | show | jobs
by haberman 5534 days ago
See if you can find some bottleneck in one of your Python/Ruby/Perl apps that's chewing a lot of CPU time. See if you can devise a definition for a relatively simple function that if it was REALLY FAST would make this hot spot a lot more efficient. Then implement that function in C and expose it to the high level language.

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.

1 comments

> See if you can find some bottleneck in one of your Python/Ruby/Perl apps that's chewing a lot of CPU time.

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.

> I found that hard to do as a starting developer who didn't know what was actually a bottleneck in my code

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! :)