由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [合集] c/c++ simple question: efficiency of array/buffer acces
相关主题
请教改numpy array的dtype如何保存一个stl容器的完整内容
一个弱智问题,请大牛看看:找出1000000以内质数数目,要求快golang的method是后来加的?
linux 下从c++动态内存操作问题,heap size不够还是别的?c的问题(2)
一个小问题Python里边file writer的问题
c++ template中如何判断类型a simple question
[合集] address of arraydoes the system guarantee this? (转载)
[合集] 读一个4MB的文件,大家一半都用多少时间?multi-thread 一问,
merge sort: could the merge step be done with O(n) time and O(1) space?OpenGL能否方便实现自定义图形的移动,擦除和分层显示?
相关话题的讨论汇总
话题: array话题: acces话题: efficiency话题: buffer话题: long
进入Programming版参与讨论
1 (共1页)
s*******e
发帖数: 664
1
☆─────────────────────────────────────☆
jindj (见过没) 于 (Thu Jan 7 23:06:33 2010, 美东) 提到:
which one is faster in the example?
float f[10000];
going through its elements over and over using:
1. f[i] 下标变量
2. *(f+i) 指针位移
Long long ago, I had been told in class that the 2nd is faster; I did some
tests but the results are not consistent - it seems true for a "float" array
, but it's opposite for a "double" array. weird.
☆─────────────────────────────────────☆
bullmj (牛马甲) 于 (Thu Jan 7 23:25:
1 (共1页)
进入Programming版参与讨论
相关主题
OpenGL能否方便实现自定义图形的移动,擦除和分层显示?c++ template中如何判断类型
A question about sharing data inside a C++ class[合集] address of array
新人5个包子请教问题,redhat读写文件的内存问题 (转载)[合集] 读一个4MB的文件,大家一半都用多少时间?
怎么efficiently实现next_combination?merge sort: could the merge step be done with O(n) time and O(1) space?
请教改numpy array的dtype如何保存一个stl容器的完整内容
一个弱智问题,请大牛看看:找出1000000以内质数数目,要求快golang的method是后来加的?
linux 下从c++动态内存操作问题,heap size不够还是别的?c的问题(2)
一个小问题Python里边file writer的问题
相关话题的讨论汇总
话题: array话题: acces话题: efficiency话题: buffer话题: long