First, I gonna post my test result with some code:

 //test the peformance of the <normal operation> and the <shift operation>.
class ShiftOperation
{
public static void main(String[] args)
{
long startTime1 = System.nanoTime();
for(long i = 0; i < 10000000000L; i++){
int temp = 128 * 128;
}
long endTime1 = System.nanoTime();
System.out.println("elapse = " + (endTime1 - startTime1) + " ns");
//outputs:elapse = 13265249285 ns long startTime2 = System.nanoTime();
for(long i = 0; i < 10000000000L; i++){
int temp = 128 << 8;
}
long endTime2 = System.nanoTime();
System.out.println("elapse = " + (endTime2 - startTime2) + " ns");
//outputs:elapse = 12723663971 ns
}
}

The below screen shot shows the simple steps of the operations between the two.

The performance between the 'normal' operation and the 'shift' operation.的更多相关文章

  1. Ubuntu 出现 Invalid operation update 或 Invalid operation upgrade的解决办法

    输入 sudo apt update && sudo apt full-upgrade

  2. iOS 并发编程之 Operation Queues

    现如今移动设备也早已经进入了多核心 CPU 时代,并且随着时间的推移,CPU 的核心数只会增加不会减少.而作为软件开发者,我们需要做的就是尽可能地提高应用的并发性,来充分利用这些多核心 CPU 的性能 ...

  3. System and method for dynamically adjusting to CPU performance changes

    FIELD OF THE INVENTION The present invention is related to computing systems, and more particularly ...

  4. RFC 8684---TCP Extensions for Multipath Operation with Multiple Addresses

    https://datatracker.ietf.org/doc/rfc8684/?include_text=1 TCP Extensions for Multipath Operation with ...

  5. iOS:缓存与Operation优先级问题

    这篇博客来源于今年的一个面试题,当我们使用SDWebImgae框架中的sd_setImageWithURL: placeholderImage:方法在tableView或者collectionView ...

  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. Async Performance: Understanding the Costs of Async and Await

    Stephen Toub Download the Code Sample Asynchronous programming has long been the realm of only the m ...

  8. 多线程:Operation(一)

    1. 进程和线程 1.1 进程 进程:正在运行的应用程序叫进程 进程之间都是独立的,运行在专用且受保护的内存空间中 两个进程之间无法通讯 通俗的理解,手机上同时开启了两个App.这两个App肯定是在不 ...

  9. Task-based Asynchronous Operation in WCF z

    Download source - 93.5 KB Introduction Though performance blocking and sluggishness are the tailback ...

随机推荐

  1. 【UVA10829】 L-Gap Substrings (后缀数组)

    Description If a string is in the form UVU, where U is not empty, and V has exactly L characters, we ...

  2. Ajaxupload插件超级简单使用(php的ci框架)

                         Ajaxupload简单使用  友情提示:1.蓝色文字为必修改内容.2.#字符后面是解释该代码段的主要内容  备注: 该实例是用php的ci框架直接接收图片并 ...

  3. AStyle代码格式工具在source insight中的使用

    一.AStyle下载路径 Astyle为开源项目,支持C/C++和java的代码格式化 Home Page: http://astyle.sourceforge.net/ Project Page:  ...

  4. RESTful, 说说 http 的 patch method

    最早的时候,我们只需要 GET 和 POST 方法,POST 方法的引入也只是为了消除 URL 过长,参数隐藏,上传文件的问题,完全和语义无关.接触到 RESTful 之后,我们开始思考 GET 和 ...

  5. translate函数使用

    SQL> select data,translate(data,'0123456789','##########') as num1, replace(translate(data,'01234 ...

  6. SQL语句 远程操作数据库

    --远程操作数据库SQL语句exec sp_addlinkedserver 'ITSV ', ' ', 'SQLOLEDB ', '211.81.251.85 'exec sp_addlinkedsr ...

  7. openStack 性能开测

  8. hdoj 1342 Lotto【dfs】

    Lotto Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submi ...

  9. Python安装scipy

    1.下载numpy+mkl 下载链接:http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy 2.下载scipy 下载链接:http://www.lfd.uc ...

  10. JAVA去掉字符串前面的0

    最佳方案:使用正则 String str = "000000001234034120"; String newStr = str.replaceAll("^(0+)&qu ...