The performance between the 'normal' operation and the 'shift' operation.
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.的更多相关文章
- Ubuntu 出现 Invalid operation update 或 Invalid operation upgrade的解决办法
输入 sudo apt update && sudo apt full-upgrade
- iOS 并发编程之 Operation Queues
现如今移动设备也早已经进入了多核心 CPU 时代,并且随着时间的推移,CPU 的核心数只会增加不会减少.而作为软件开发者,我们需要做的就是尽可能地提高应用的并发性,来充分利用这些多核心 CPU 的性能 ...
- 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 ...
- 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 ...
- iOS:缓存与Operation优先级问题
这篇博客来源于今年的一个面试题,当我们使用SDWebImgae框架中的sd_setImageWithURL: placeholderImage:方法在tableView或者collectionView ...
- Thinking Clearly about Performance
http://queue.acm.org/detail.cfm?id=1854041 The July/August issue of acmqueue is out now acmqueue is ...
- 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 ...
- 多线程:Operation(一)
1. 进程和线程 1.1 进程 进程:正在运行的应用程序叫进程 进程之间都是独立的,运行在专用且受保护的内存空间中 两个进程之间无法通讯 通俗的理解,手机上同时开启了两个App.这两个App肯定是在不 ...
- Task-based Asynchronous Operation in WCF z
Download source - 93.5 KB Introduction Though performance blocking and sluggishness are the tailback ...
随机推荐
- Party
hdu3062:http://acm.hdu.edu.cn/showproblem.php?pid=3062 题意:中文题. 题解:很明显的2-sat.然后要深刻理解命题和逆否命题.如这一题,c1,c ...
- 用状态机STATE MACHINE实现有选择的文件转换
用书上的例子实现在解析HTML文本时,对"<>"中的符号不进行字符转换. import sys import string from optparse import O ...
- MFC窗口风格 WS_style/WS_EX_style(超详细)
窗口风格(Window style) WS_BORDER 有边框窗口 WS_CAPTION 必须和WS_BORDER风格配合,但不能与WS_DLGFRAME风格一起使用.指示窗口包含标题要部分 ...
- mysql优化21条经验(转)
今天,数据库的操作越来越成为整个应用的性能瓶颈了,这点对于Web应用尤其明显.关于数据库的性能,这并不只是DBA才需要担心的事,而这更是我们程序 员需要去关注的事情.当我们去设计数据库表结构,对操作数 ...
- openwrt使用3G上网卡
尊敬的大大.感谢你抽空指导我 我的设备是db120 mu350 和广东无限卡 版本是OpenWrt Backfire 10.03.336 DIY full 一. 没有安装到kmod-us ...
- 我要爱死这个markdown 了
今天上班依旧看wpdang的文章,最后作者说,文章使用markdown写的,好奇心促使我搜了一把什么是markdown.然后看到了这篇文章,一瞬间就开始兴奋了.顿时觉得,这个东西太好用 了,简直又激起 ...
- Response.ContentType 详细列表 <转>
Response.ContentType 详细列表 不同的ContentType 会影响客户端所看到的效果.默认的ContentType为 text/html 也就是网页格式.代码如: <% ...
- 【转】微信Android SDK示例代码及运行方法
原文网址:http://blog.csdn.net/icyfox_bupt/article/details/23742217 最近在研究微信SDK,无奈网上好使的教程太少,对于程序员来说最好的东西,一 ...
- 利用NSIS软件制作C#安装包
最近在做C#程序安装包,结果网上看到这个软件还是不错的,可以尝试以下. NSIS 是“Nullsoft 脚本安装系统”(Nullsoft Scriptable Installation System) ...
- java 打包插件
是时候闭环Java应用了 原创 2016-08-16 张开涛 你曾经因为部署/上线而痛苦吗?你曾经因为要去运维那改配置而烦恼吗?在我接触过的一些部署/上线方式中,曾碰到过以下一些问题: 1.程序代码 ...