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 ...
随机推荐
- Let's go home
hdu1824:http://acm.hdu.edu.cn/showproblem.php?pid=1824 题意:中文题. 题解:这一题建边要考虑两个限制条件,一个是队伍内部的,就是假如说 a,b, ...
- Javascript函数中传递带空格的参数
通常在页面中要让某些内容点击后产 生点击事件(非页面跳转)都会使用onclick,但是这样不适于需要传递参数的情况,于是写成直接调用Javascript函数的方式:<a href=javascr ...
- LeetCode 面试:Add Two Numbers
1 题目 You are given two linked lists representing two non-negative numbers. The digits are stored in ...
- centos本地源搭建——iso
说明:centos源搭建比另一篇ubuntu源搭建简单些,操作也简单.思路是用iso制作一个本地源,后期需要新软件可以自己添加. 1.进入iso挂载路径,这里是虚拟机,在vm上挂载,在linux下直接 ...
- Maven学习(1) - Maven入门
home index:http://maven.apache.org/ download:http://maven.apache.org/download.cgi install: http://ma ...
- inuitcss
inuitcssa powerful, scalable, Sass-based, BEM, OOCSS framework.
- What version of .NET Framework is integrated into what version of OS?
http://blogs.msdn.com/b/astebner/archive/2007/03/14/mailbag-what-version-of-the-net-framework-is-inc ...
- SRM 387(1-250pt)
DIV1 300pt 题意:有m种颜色的球若干个放在n个盒子里.每次操作可从一个盒子里拿出任意个球(不必同色),放进另一个盒子.要求终态为:1.最多有一个盒子里面装有不同色的球,该盒子成为joker ...
- Ural 1332 把圆细分+圆内切,内含关系判定
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1332 #include<cstdio> #include<cstrin ...
- 回某位朋友问题备受phpcgi.exe煎熬现在cpu跑满(解决方案)
(本文原创,但是cgi参数参考一个大神写的针对小服务器的,希望大家积极投票哦) 下面是对php-cgi.ext过多引起服务器cup%的解决方法,希望对大家有帮助;大多数情况是发生在第四项上; 解决 ...