善于使用HashSet和Dictionary使系统性能绝大的提升。

废话不说。直接上代码。

 

1
2
3
4
5
6
7
8
9
10
11
private static HashSet<string> hashSetLocationIds = new HashSet<string>();
 
 
 
string id = string.Format("{0}{1}{2}{3}{4}", 1,2,3,4).md5();
 
if (hashSetLocationIds.Contains(id)) return;
if (hashSetLocationIds.Count > 1x) hashSetLocationIds.Clear();
hashSetLocationIds.Add(id);
 
//you business code

  

2CPU+2G内存的低端入门级服务器配置。

 

 

 

 

 

end

 

posted @   liskov_design  阅读(30)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
点击右上角即可分享
微信分享提示