V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
laoni
V2EX  ›  问与答

业余时间写了一个脏词过滤服务, GOLANG 写的

  •  
  •   laoni · Jun 12, 2016 · 10291 views
    This topic created in 3618 days ago, the information mentioned may be changed or developed.

    https://github.com/nixuehan/rabbit 支持多脏词组合 比如: 哇哈哈+蛋蛋蛋 只有同时存在哇哈哈和蛋蛋蛋 才会 hit 到。 还支持简繁体等一般的畸形纠正。 之前用 PHP 和 lua 都实现过。。但性能不行。最后 golang 靠谱

    我用我的 MAC 压测了下

    MAC 压测下。配置如下: Intel Core i5 1.6 GHz .内存 8 GB.

    wrk -t8 -c100 -d60s --script=./post.lua http://127.0.0.1:9394/filter 数据如下:

    Running 1m test @ http://127.0.0.1:9394/filter 8 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 7.76ms 12.46ms 245.15ms 90.71% Req/Sec 2.62k 637.00 12.44k 79.64% 1253342 requests in 1.00m, 198.42MB read Requests/sec: 20853.38 Transfer/sec: 3.30MB

    还行。。 golang 大法好呀

    ahillgian
        1
    ahillgian  
       Jun 12, 2016
    一直觉得脏话不应该被过滤.
    Niphor
        2
    Niphor  
       Jun 12, 2016
    原来不开源...
    Cavolo
        3
    Cavolo  
       Jun 12, 2016 via iPhone
    @ahillgian 脏话应该过滤,习习蛤蛤这类不应该过滤
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2671 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 15:53 · PVG 23:53 · LAX 08:53 · JFK 11:53
    ♥ Do have faith in what you're doing.