For all of we programmers,we should always remember that "Premature optimization is the root of all evil". (Ref)

  When again,I come back to the 'Data Structure and Algorithm',following the algorithms that the .net provides,using the '.net reflector',I realise that I was too much care about something(for i am not work strict to memory and CPU circle limits).

  The issue I posted  "Would it cost any extra performance if multiple invoke methods that are overload?on the forum "Stackoverflow" shows the issue that confused me before.

  That issue comes from .net ArrayList class,such as the code below:

 public static void Copy(Array sourceArray, Array destinationArray, int length)
{
if (sourceArray == null)
{
throw new ArgumentNullException("sourceArray");
}
if (destinationArray == null)
{
throw new ArgumentNullException("destinationArray");
}
Copy(sourceArray, sourceArray.GetLowerBound(), destinationArray, destinationArray.GetLowerBound(), length, false);
}

  it actually calls

 Copy(sourceArray, sourceArray.GetLowerBound(), destinationArray, destinationArray.GetLowerBound(), length, false);
 internal static extern void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length, bool reliable);

as it is obvious.

  The method call between themselves can be 'inlined',or the opitimized by jitter.

  And remember that "Premature optimization is the root of all evil". Take much time to think about our own algorithms.

Premature optimization is the root of all evil.的更多相关文章

  1. JavaScript性能优化

    如今主流浏览器都在比拼JavaScript引擎的执行速度,但最终都会达到一个理论极限,即无限接近编译后程序执行速度. 这种情况下决定程序速度的另一个重要因素就是代码本身. 在这里我们会分门别类的介绍J ...

  2. NoSQL数据库笔谈(转)

    NoSQL数据库笔谈 databases , appdir , node , paper颜开 , v0.2 , 2010.2 序 思想篇 CAP 最终一致性 变体 BASE 其他 I/O的五分钟法则 ...

  3. python笔记-python编程优化:常用原则和技术介绍

    本人翻译自<Exper Python Programming> 'Premature optimization is the root of all evil in programming ...

  4. 一个超复杂的间接递归——C语言初学者代码中的常见错误与瑕疵(6)

    问题: 问题出处见 C语言初学者代码中的常见错误与瑕疵(5) . 在该文的最后,曾提到完成的代码还有进一步改进的余地.本文完成了这个改进.所以本文讨论的并不是初学者代码中的常见错误与瑕疵,而是对我自己 ...

  5. GPU 优化总结

    前面说了对我这一年多的工作进行一个总结,由于工作比较紧,加上本人比较懒,一直没能抽出时间来写,最近稍微闲下来了.先写一篇GPU优化的,后续的文章希望能慢慢补齐.这些基本都是我个人优化的实际经验,也参考 ...

  6. Thinking Clearly about Performance

    http://queue.acm.org/detail.cfm?id=1854041 The July/August issue of acmqueue is out now acmqueue is ...

  7. [翻译]HTML中不知名的语义标签

    原文:http://docs.webplatform.org/wiki/tutorials/Lesser_-_known_semantic_elements HTML5中比较常用的语义元素有heade ...

  8. Code Complete阅读笔记(二)

    2015-03-06   328   Unusual Data Types    ——You can carry this technique to extremes,putting all the ...

  9. 侯捷C++ Type traits(类型萃取

    泛型編程編出來的代碼,適用於任何「吻合某種條件限制」的資料型別.這已成為撰寫可復用代碼時的一個重要選擇.然而,總有一些時候,泛型不夠好 — 有時候是因為不同的型別差距過大,難以產生一致的泛化實作版本. ...

随机推荐

  1. 你真的了解 MySQL 数据库的运行状况吗?

    2015年第三方市场调查机构 Evans 数据公司最近公布的一系列客户调查数据显示,在过去两年里,MySQL 在所有开发者使用的数据库中获得了25%的市场份额,Evans 公司的本次调查显示,数据库的 ...

  2. Jsp中获得集合List或Set的长度

    首先要引入<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> ...

  3. 【HDOJ】1814 Peaceful Commission

    2-SAT基础题目. /* 1814 */ #include <iostream> #include <vector> #include <algorithm> # ...

  4. 从 mian 函数开始一步一步分析 nginx 执行流程(四)

    如不做特殊说明,本博客所使用的 nginx 源码版本是 1.0.14,[] 中是代码所在的文件! 这一节我们分析ngx_worker_process_cycle(),该函数代码比较少,因为它通过调用函 ...

  5. jQuery动态五星评分

    效果 css .star ul, .star li { list-style: none; } .star { position: relative; width: 600px; height: 24 ...

  6. R语言 数据的输入方式总结

    1.使用C函数连接数据 2.使用c,cbind,rbind结合变量 3.使用Vector函数结合数据 4.使用矩阵结合数据5.使用data.frame函数结合数据 6.使用list函数结合数据 c 向 ...

  7. Xamarin最新crack 包含IOS

    Xamarin.Android 4.10.01068 & Xamarin.iOS 1.8.361 28 Comments   tweet     inShare   NEW support f ...

  8. Linux学习笔记25——命名管道(FIFO)

    1 命名管道(FIFO) 管道应用的一个重大缺陷就是没有名字,因此只能用于亲缘进程之间的通信.后来从管道为基础提出命名管道(named pipe,FIFO)的概念,该限制得到了克服.FIFO不同于管道 ...

  9. Unity3d 基于物理渲染Physically-Based Rendering之最终篇

    前情提要: 讲求基本算法 Unity3d 基于物理渲染Physically-Based Rendering之specular BRDF plus篇 Unity3d 基于物理渲染Physically-B ...

  10. ssh互信自动化脚本(待更新)

    1.建立一个ip,端口,用户,密码列表 [root@localhost shell-key]# cat arg_list.txt 172.16.56.215 172.16.56.215 172.16. ...