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 ...
随机推荐
- quartz定时任务时间配置
quartz定时任务时间设置描述(2011-03-03 16:23:50)转载▼标签: quartz时间it 分类: 凌乱小记 这些星号由左到右按顺序代表 : * * * ...
- java 表格项的删除、编辑、增加 修改版
修改之后的java 代码: package com.platformda.optimize; import java.awt.BorderLayout; import java.awt.Button; ...
- 根据rowid回表
select rowid from T_PM_DEPOSIT_HIS partition(DEPOSIT_HIS_20120104) ; SQL> set linesize 200 SQL> ...
- 支付宝APP支付(Java后台生成签名具体步骤)
/** *支付宝支付 * @param orderId 订单编号 * @param actualPay 实际支付金额 * @return */ private String getOrderInfoB ...
- [Exchange]2个不同域之间互发邮件
1.互相添加DNS. 不多说,构建信任域也需要这样的 2.DNS中添加Exchange的地址解析. 3.配置Exchange. 在exchange里面添加对方的exchange信息 在Receiver ...
- Android手机应用程序开发环境配置(Eclipse+Java+ADT)
参考: Java手机游戏开发实例简明教程 http://dev.10086.cn/blog/?uid-82940-action-viewspace-itemid-1772 Eclipse下载: htt ...
- 从Java视角理解CPU缓存(CPU Cache)
从Java视角理解系统结构连载, 关注我的微博(链接)了解最新动态众所周知, CPU是计算机的大脑, 它负责执行程序的指令; 内存负责存数据, 包括程序自身数据. 同样大家都知道, 内存比CPU慢很多 ...
- java对Ldap操作2
package ldap.pojo;import java.util.List;/** * @author 张亮 * ldap用户属性信息数据类 */public class LdapPersonI ...
- 提高效率 常用的几个xcode快捷键
能用好快捷键,不仅仅可以提高工作效率,而且让你看起来更加的自信和能干,下面几个常用的快捷键,希望对你在工作中有帮助 1.首先说明一下几个标示的意思 Command ⌘ Control ⌃ ...
- kafka配额控制
转载请注明地址http://www.cnblogs.com/dongxiao-yang/p/5217754.html Starting in 0.9, the Kafka cluster has th ...