martynsmith/node-irc — pull request #211 by expr (2013-12-02 00:51:54+00:00)
Title: Replace old parser with irc-message module.

I've been working on a lot of IRC-related modules for node recently. Most spawned from not liking how node-irc does things, or being unhappy with it performance wise (i.e. when handling a ton of sockets/data).

As I was in the process of creating a client library to replace node-irc for my needs (which I've since discarded), I created a super efficient IRC message parser. The message parser is very simple; it's initialised with a line of IRC, it parses it and the following are produced:

- `tags` - IRCv3.2 message tags if present. Can be used for server-time with ZNC, for example.
- `prefix`
- `command`
- `args`

I've released this as a separate module on npm, called `irc-message`.

This pull request is a small rewrite of the parseMessage() function to make use of `irc-message`. It's completely backwards compatible with the old parser, but offers up to **3 times better performance**. This is mostly due to getting rid of regular expressions, amongst many other optimisations I've made when writing it.