- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我做了一个比较 .NET 的小型测试基准测试 System.Security.Cryptography
AES 实现与 BouncyCaSTLe.Org 的 AES。
GitHub 代码链接:https://github.com/sidshetye/BouncyBench
我对 AES-GCM 特别感兴趣,因为它是一种“更好的”加密算法,而 .NET 缺少它。我注意到,虽然 .NET 和 BouncyCaSTLe 之间的 AES 实现非常相似,但 GCM 的性能却很差(有关更多信息,请参阅下面的额外背景)。我怀疑这是由于许多缓冲区副本或其他原因。为了更深入地研究,我尝试分析代码(VS2012 => Analyze
菜单栏选项 => Launch performance wizard
)并注意到 mscorlib.dll 中有很多 CPU 消耗
问题:在这种情况下,我如何找出消耗大部分 CPU 的资源? 现在我所知道的是“Init() 中的某些行/调用在 mscorlib.ni.dll 中消耗了 47% 的 CPU” - 但不知 Prop 体的行,我不知道在哪里(尝试和)优化。有什么线索吗?
额外背景:
基于 David A. McGrew 的“The Galois/Counter Mode of Operation (GCM)”论文,我读到“二进制字段中的乘法可以使用多种时间-内存权衡。它可以在没有依赖于键的内存的情况下实现,在这种情况下,它的运行速度通常会比 AES 慢几倍。愿意牺牲适量内存的实现可以轻松实现 的速度高于 AES 的速度。”
如果您查看结果,基本的 AES-CBC 引擎性能非常具有可比性。 AES-GCM 添加 GCM 并在 CTR 模式(比 CBC 更快)下重用其下方的 AES 引擎。但是,除了 CTR 模式之外,GCM 还在 GF(2^128) 字段中添加了乘法,因此可能存在其他减速区域。无论如何,这就是我尝试分析代码的原因。
对于感兴趣的人,我的快速测试性能基准在哪里。它位于 Windows 8 VM 和 YMMV 中。该测试是可配置的,但目前它是模拟加密数据库中许多单元格的加密开销(=> 很多但很小的纯文本输入)
Creating initial random bytes ...
Benchmark test is : Encrypt=>Decrypt 10 bytes 100 times
Name time (ms) plain(bytes) encypted(bytes) byte overhead
.NET ciphers
AES128 1.5969 10 32 220 %
AES256 1.4131 10 32 220 %
AES128-HMACSHA256 2.5834 10 64 540 %
AES256-HMACSHA256 2.6029 10 64 540 %
BouncyCastle Ciphers
AES128/CBC 1.3691 10 32 220 %
AES256/CBC 1.5798 10 32 220 %
AES128-GCM 26.5225 10 42 320 %
AES256-GCM 26.3741 10 42 320 %
R - Rerun tests
C - Change size(10) and iterations(100)
Q - Quit
最佳答案
这是微软的一个相当蹩脚的举动,因为他们显然破坏了在 Windows 8 之前运行良好但不再运行的功能,如 this MSDN blog post 中所述。 :
:
On Windows 8 the profiler uses a different underlying technology than what it does on previous versions of Windows, which is why the behavior is different on Windows 8. With the new technology, the profiler needs the symbol file (PDB) to know what function is currently executing inside NGEN’d images.
It is however on our backlog to implement in the next version of Visual Studio.
关于encryption - 代码分析以提高性能 : see CPU cycles inside mscorlib. dll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14573972/
发生这种情况是否有特定原因,或者可能有很多不同的原因?我不知道为什么我的程序打印出它正在打印的值,因为我希望它打印出整数。相反,我得到了这个: 周期@173a10f循环@a62fc3循环@a62fc3
长期读者,第一次发帖。 :) 我正在使用 jQuery Cycle 插件,可以在此处下载:http://jquery.malsup.com/cycle/ 我在帖子部分工作得很好,但是收到了一个请求,要
我正在使用 Malsup 的 Cycle() JQuery 插件,并尝试让它显示图库中的图像、缩略图列表以及每个缩略图下的标题。我的代码如下:
我在页面上使用jQuery Cycle(完整)插件,在该页面上使用宽度为75%的容器DIV(.content-left),并且在该容器内部使用jQuery Cycle幻灯片放映。该容器内的图像应自动调
我正在尝试使用 AFNetworking2.6.3 的 UIImageView 扩展从远程服务器获取图像。一切正常,图像已返回并成功渲染。但我在 Xcode7.3.1 中收到保留周期警告:在此 blo
我收到以下错误: [循环]终止;幻灯片太少:1 下面是 jQuery Cycle 的代码。我不知道为什么 Chrome 中会出现这个 var inners = $('ul#output li').cy
看来我已经超越了自己。一直以来,我都在创建这个漂亮的“最新消息”小部件,它会在鼠标悬停在每个 anchor 上时消失。然后我的同事说,“嘿,克里斯,这些链接不起作用” ...糟糕。我想知道我是否可以让
我可能在尝试一些愚蠢的事情,但我有一个足够大的 非-onionified Cycle.js 应用程序,我正在尝试学习如何 onionify可行,所以我想将一个 onionified 组件嵌入到我原来的
我必须检查 jQuery Cycle 幻灯片是否终止。我需要检查一下,因为我有多个幻灯片,我按顺序运行它,但是,当出现日志“[cycle] termination;too少幻灯片:1”时,因为幻灯片只
我构建了一个图像 slider ,旨在通过淡入和淡出在四个图像之间进行转换。我使用了 J Query 插件“Cycle”并将效果设置为“淡入淡出”。我还希望让用户能够通过将光标悬停在图像上来暂停幻灯片
我在我的程序中实现了这个伪代码来检查有向图是否是非循环的: L ← Empty list that will contain the sorted elements S ← Set of all no
我有时读到有些指令需要的时间少于一个时钟周期——这怎么可能?或者这就是流水线和乱序进入游戏时的值(value)? 最佳答案 来自 http://en.wikibooks.org/wiki/Microp
我需要能够通过程序循环我的 linksys 路由器,我想这样做的原因很复杂,所以让我们假设没有更好的选择。 有没有办法做到这一点?我认为这是因为当我通过管理控制台向路由器安装固件更新时,它会循环路由器
(我使用 OCaml 版本 4.02.3) 我定义了一个类型 self # type self = Self of self;; type self = Self of self 及其实例 s # l
我有相对较小(40-80 个节点)三次(3-正则)平面图,我必须确定它们的哈密顿性。我知道这个任务是 NP 完全的,但我希望渐近指数时间算法对于我感兴趣的图大小来说仍然非常快。 最佳答案 40 个节点
如何使用具有三个值的 {cycle}?这段代码有什么问题: value value1 最佳答案 我认为你需要给它们起唯一的名字: {cycle name='
我目前正在使用 jQuery.Cycle 来循环几个子项 标签。但是,我希望默认的周期 fx 为 fade ,当我点击next时或prev选择器,我希望循环效果暂时更改为 scrollRight或sc
我的 jQuery.cycle 插件有问题。第一次加载页面时(当未缓存图像时),它显示小图像,例如缩略图。您可以在(编辑:抱歉,旧链接)看到它 - 只需等待第二张图片显示即可 - 它很小。重新加载/刷
我正在使用循环插件并且它运行良好。但是 slider 一直在滑动,我不知道应该使用什么选项来防止它自动播放。 $('#thumbs').cycle({ fx: 'scrollH
我使用循环构建了一个播放器,可以循环播放各种宣传片,但我想为每个页面(1、2、3 等除外)定义特定的描述性寻呼机链接。我知道这应该是可能的,但不知道如何实现...即使我在寻呼机 div 中添加了元素,
我是一名优秀的程序员,十分优秀!