This is the sixth bimonthly 'What are you working On?' thread. Previous threads are here. So here's the question:
What are you working on?
Here are some guidelines:
- Focus on projects that you have recently made progress on, not projects that you're thinking about doing but haven't started.
- Why this project and not others? Mention reasons why you're doing the project and/or why others should contribute to your project (if applicable).
- Talk about your goals for the project.
- Any kind of project is fair game: personal improvement, research project, art project, whatever.
- Link to your work if it's linkable.
For the past couple of weeks I've been writing a utility to search through code quickly. I'm doing this because at work, some large dependencies got tossed in extern, making ack and grep pretty slow. At first I tried to make them faster (creating aliases to ignore certain files), but I soon gave up and started writing my own thing.
Grep is slow because it doesn't ignore files by default. Ack is slow because it's written in Perl. So I'm writing it in C, using libpcre for the regex matching. So far it's about 3x faster than ack and 10x faster than grep. With some tweaking to ignore special files like generated code, I got it even faster than that. (0.5 seconds to search the codebase. For comparison, grep was 12 seconds and ack was 4.)
The Github repo is here. I don't recommend anyone try it out yet. It's not even close to done. Although I use it daily, I still need to iron out some formatting bugs, a couple of potential crashes, and then write docs. I bet it'll take me a couple weeks to sort all that stuff out.
(Before anyone replies: Yes, I do know about ctags and git-grep. Ctags requires rebuilding an index after changing any files, and git-grep doesn't work on non-git repositories. Also git-grep can't ignore files committed in the repo, such as everything in extern.)
Have you considered existing solutions, such as Krugle, or IntelliJ and Eclipse's built-in tools or plugins (assuming you're coding in Java or Python or whatever else Eclipse supports) ? If so, what were their major deficiencies, and how is your solution better ? The reason I'm asking is because, well, I'm a selfish bastard who doesn't feel like implementing his own code search engine, so I might as well use yours :-)