lesismal's repos on GitHub
Go · 2116 人关注
nbio
Pure Go 1000k+ connections solution, support tls/http1.x/websocket and basically compatible with net/http, with high-performance and low memory cost, non-blocking, event-driven, easy-to-use.
Go · 923 人关注
arpc
More effective network communication, two-way calling, notify and broadcast supported.
Go · 110 人关注
go-websocket-benchmark
Go · 44 人关注
nbio-examples
Go · 11 人关注
llib
Go · 6 人关注
pipe
Go · 5 人关注
cbuffer
Go · 5 人关注
go-net-benchmark
Go · 3 人关注
go-http-server-benchmark
Go · 2 人关注
noleak
1 人关注
conc
Better structured concurrency for go
1 人关注
Developer-Books
编程开发相关书籍整理分享,持续更新...
Go · 1 人关注
perf
Go · 0 人关注
awesome-go
A curated list of awesome Go frameworks, libraries and software
0 人关注
cli
GitHub’s official command line tool
0 人关注
emoji-cheat-sheet
A markdown version emoji cheat sheet
0 人关注
engineering-blogs
A curated list of engineering blogs
Go · 0 人关注
gevent-benchmark
Go · 0 人关注
gin
Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
Go · 0 人关注
go
The Go programming language
Go · 0 人关注
gopkg
Universal Utilities for Go
0 人关注
guide
The Uber Go Style Guide.
Go · 0 人关注
gws
High-Performance Go WebSocket Server & Client
0 人关注
http-parser
http request/response parser for c
Go · 0 人关注
kcp-go
A Crypto-Secure, Production-Grade Reliable-UDP Library for golang with FEC
Go · 0 人关注
kitex-benchmark
0 人关注
lesismal
HTML · 0 人关注
lesismal.github.io
Go · 0 人关注
melody
:notes: Minimalist websocket framework for Go
Go · 0 人关注
mempooldebug
lesismal

lesismal

V2EX 第 497905 号会员,加入于 2020-07-06 13:49:58 +08:00
美国宣布全面禁止竞业协议
程序员  •  lesismal  •  73 天前  •  最后回复来自 ChrisFreeMan
2
github 被人 at 说币安空投,是诈骗吗?
程序员  •  lesismal  •  207 天前  •  最后回复来自 lesismal
2
4C-2G 来战 [ Golang Websocket 百万连接测试 ]
程序员  •  lesismal  •  227 天前  •  最后回复来自 lesismal
34
nbio 近期的一些功能更新,来骗点 star
  •  1   
    Go 编程语言  •  lesismal  •  2023-04-18 14:04:25 PM  •  最后回复来自 lesismal
    2
    吃八分饱长寿与充电 85%能保护电池
  •  1   
    硬件  •  lesismal  •  2022-05-06 13:22:14 PM  •  最后回复来自 julyclyde
    22
    lesismal 最近回复了
    A1 这种直接查 map 就行了,无需遍历

    ### 查表法
    1. A2 这种涉及顺序的,可以使用查表的方法:
    开奖结果的 hash 值作为 mapA 的 key ,因为是 5 个数字而且彩票这种数字通常不大,一个 uint64 甚至 uint32 就足够做 hash 值了。每个奖期信息作为 value 并且排序后的数组作为 map 的 value 。如果用 c++,multimap 内部红黑树自动就是排好序的,不需要自己排序数组之类的

    假设不同的下标为 targetIndex=0, 然后就只要查 map hash 值得到相同的、如果不等于 targetIndex 就找 targetIndex=当前 index+1 并查找下一个 hash 相同的。当然,如果遍历平均为 5 、开销也不大, 那这种可能不划算、根据实际测试情况、可以考虑就用遍历

    2. Q15B/Q15R/P15B/P15R 这些,都可以用对应期段的数据建各自对应的表,然后直接查表就能计算出 key 对应的 value 数量,不需要遍历几十期、匹配上则+1 的方式去计算

    这个过程中只建表一次,然后上面的 1/2/3 都是直接查 map 就出结果了

    ### C618
    建表的过程可以同时根据期号做倒排索引,C618 回退 618 期、计算每期时,把上述过程中建表的只需要删除临界的一期、加入需要的一期,所以这个过程中不需要重复建整个表,只是滚动删、增一期,整个流程的建表开销不需要太大


    我不了解实际需求,以上仅供参考
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2305 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 01:26 · PVG 09:26 · LAX 18:26 · JFK 21:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.