[erlang-questions] FW: word filtering

Richard Carlsson <>
Tue Jun 5 14:25:07 CEST 2007


shehan wrote:
> I want to write spam detecting (word filtering) function. I already know
> that regexp can be used for that & it is just string comparing & too
> slow when used in high volume usage.(ex: 500 text messages/sec) Can
> somebody tell me that, is there any method in Erlang to filter words
> faster than regexp? 

Before you spend time thinking about other alternatives: have you
actually _checked_ if matching speed is an issue here? 500 messages
per second does not sound much (but of course, that depends on how
much work you need to do per message).

Try the simple solution first (i.e., use the recently posted
regexp module), and measure. If it's not fast enough, find out
what the actual bottleneck is. It might not be the matching.
Just don't conjecture that the straightforward solution will
be too slow before you have tried it.

     /Richard




More information about the erlang-questions mailing list