• stringbuilder for test performance 性能 update 性能


    写文件,20w数据,文件大小50M,string builder(256)和(512)没有太大的区别,但是整体比string要快上200ms.

    测试过程中出现了几次stringbuilder比string 慢的现象,,我认为性能上还是stringbuilder 好一些,

    stringbuilder 设置256,

    sb 256 time:964   str time:1171
    sb 256 time:953   str time:1098
    sb 256 time:1035   str time:1115
    sb 256 time:966   str time:1114
    sb 256 time:983   str time:1125
    sb 256 time:986   str time:1103
    sb 256 time:985   str time:1120
    sb 256 time:955   str time:1111
    sb 256 time:948   str time:1097
    sb 256 time:935   str time:1104
    sb 256 time:975   str time:1169
    sb 256 time:968   str time:1154
    sb 256 time:975   str time:1155
    sb 256 time:982   str time:1132
    sb 256 time:972   str time:1140
    sb 256 time:956   str time:1132
    sb 256 time:956   str time:1135
    sb 256 time:984   str time:1137
    sb 256 time:937   str time:1150

    逐行写文件,我改成5000行写一次,效率更低

    于是mark 一下  sb  better !

    cpu i7600U 16G内存, 512ssd.

    昨天测试了  update 语句,20W条数据,,

    当时是2000个id 一起,2000个update sql 一起.

    update ** set **=** where id=1 连接超时

    和update ** set **=** where id in(1,2,3) 耗时 3277 ms 区别明显

    代做毕业设计和论文 私活, 需要.net,asp.net ,mvc ef cs 客户端,bs 网站项目开发的请私信我,
  • 相关阅读:
    poj2886 Who Gets the Most Candies?
    poj1201 Intervals
    poj3109 Inner Vertices
    poj1990 MooFest
    poj3368 Frequent values
    NOIP练习赛题目6
    NOIP练习赛题目5
    NOIP练习赛题目4
    NOIP练习赛题目3
    NOIP练习赛题目2
  • 原文地址:https://www.cnblogs.com/duguzhenglong/p/7127076.html
Copyright © 2020-2023  润新知