Skip to content

Instantly share code, notes, and snippets.

View xinydev's full-sized avatar

Xin Yang xinydev

  • 21:22 (UTC +08:00)
View GitHub Profile
@xinydev
xinydev / python gen_mask() benchmark
Last active June 27, 2023 05:54
python lru_cache performance is greater than custom write cache in global variable
import timeit
from functools import lru_cache
def GENMASK_ULL(high: int, low: int) -> int:
return ((1 << ((high) - (low) + 1)) - 1) << (low)
def gen_mask(high: int, low: int) -> int:
high_mask = (1 << (high + 1)) - 1
[custom]
;不要随意改变关键字,否则会导致出错
;acl4SSR规则
;去广告:支持
;自动测速:支持
;微软分流:支持
;苹果分流:支持
;增强中国IP段:支持
;增强国外GFW:支持