Can you believe it?

上次做了几个优化之后,发现系统当中如果有800个BUG的时候,显示测试报告详细信息的那个页面还是比较慢,大约要18s,实在是难于忍受。

虽说显示这个页面需要做很多的统计查询。但是,我已经对统计查询做过优化优化了,怎么还会花费这么长时间呢?拿出具体的数据看看是解决问题的最好方法,看具体那个方法执行得比较耗时。

结果出来,几个我认为比较耗时的数据库查询,其实根本就不耗时啊……一个是90ms,其它三个都低于50ms,也就是说页面显示这么慢,根本不是数据库查询的结果,瓶颈应该在其它地方。

拿到显示这个页面的Action一看,有一段代码看不懂了。在这个页面上没有必要做转换列表的操作啊,于是怀疑是否这个ACTION是否做了多余的操作。再查看JSP,如果没有用到Action当中设置的属性。因此,断定那段代码是多余的。

怎么会产生这段多余代码呢,肯定是因为在修改代码的过程中,程序员忘记删除这段耗时的代码了。

修改之后一看,18s -> 0.8s。真是太好了。问题解决了,一切OK。

这个问题说明三点:
1. 不要怀疑数据库的性能。
2. 一定要实际去测试一下,不要妄加猜测。
3. 写程序的时候,代码结构要清楚。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Mars is the fourth planet in our solar system and is known as the "Red Planet" due to its reddish appearance. It is roughly half the size of Earth and has a thin atmosphere composed mainly of carbon dioxide. Mars has long been of interest to humans due to its potential for supporting life and its proximity to Earth. Space exploration is important for several reasons. Firstly, it allows us to learn more about the universe and how it works, which can help us understand our place in it. Secondly, it allows us to search for extraterrestrial life and to study planets like Mars for potential colonization or resource extraction. Thirdly, space exploration has a significant impact on technological advancement and innovation, leading to spin-off technologies that can benefit society in a variety of ways. Mars exploration, in particular, has received a great deal of attention in recent years due to its potential for supporting human life. Scientists believe that Mars once had a more Earth-like environment and may have supported microbial life in the past. Studying Mars can help us better understand the conditions necessary for life to exist and how we might create those conditions on other planets in the future. In addition, Mars has the potential to serve as a location for human settlement or resource extraction. Mars contains a variety of minerals and resources that could be valuable in future space exploration or even back on Earth. Colonizing Mars would also provide backup for human civilization in the event of a catastrophic event on Earth. Overall, space exploration, and Mars exploration in particular, are crucial for advancing our understanding of the universe and our place in it, discovering potential extraterrestrial life, and laying the foundation for future human settlement and resource extraction.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值