- 博客(20)
- 资源 (6)
- 收藏
- 关注
原创 我的七个建议
作者:Joel Spolsky [编者按]由于Joel Spolsky的双重身份(昔日耶鲁大学计算机系学长,今日Fog Creek软件公司的CEO),所以听听他的建议,对于当今无数困扰于就业压力的中国高校计算机专业学子来说,是大有裨益的。你们会发现,大多数建议,都在强调“软实力”的价值。本文转载自《软件随想录》(作者:
2010-01-31 17:11:00 1106
原创 Source Insight 快捷键集锦
Ctrl+= :Jump to definitionAlt+/ :Look up reference F9 :Jump to next referenceF7 :Look up symbolsF8 :Look up local symbolsF9 :Ident leftF10 :Ident rightAlt+, :Jump backwordAlt+. : Jump
2010-01-31 17:07:00 749
原创 Optimizing Program Performance-- 使用GPROF来查看系统的性能
Compiling a Program for Profiling首先要以特殊选项来编译程序,这样才可以产生profile。就是要加上 -pg选项 gcc -g -c myprog.c utils.c -pggcc -o myprog myprog.o utils.o -pgExecuting the Program to
2010-01-23 17:22:00 1131
原创 Optimizing Program Performance-- Summary, Performance Improvement Techniques
Although we have only considered a limited set of applications, we can draw important lessons on how towrite efficient code. We have described a number of basic strategies for optimizing program per
2010-01-22 15:57:00 1086
原创 Optimizing Program Performance--Enhanceing Parallelism
现代的CPU中,执行运算的function unit 大多是pipe line的。也就是在上一条指令没有执行完成前,就可以执行下一条指令了。 但是之前我们实现的代码并没有利用到这点,因为运算结果保存在一个变量中。这样在计算时,必须等待上一次执行的结果,来计算下一次的值,而不能利用pipe line实现同步运行了。 对于某些运算, 如加法,我们可以把将要计算的元素 分成
2010-01-17 16:31:00 958
原创 如何生成core file 及使用
程序发生crash时,linux会产生core dump。但是这个是需要配置的。 1. configure kernelmake menuconfigenter General setup & select Enable ELF core dumps 3. configure the core file limit and
2010-01-14 18:49:00 1313
原创 Optimizing Program Performance-- Reducing Loop Overhead
1 /* Accumulate result in local variable */2 void combine4(vec_ptr v, data_t *dest)3 {4 int i;5 int length = vec_length(v);6 data_t *data = get_vec_start(v);7 data_t x = ID
2010-01-12 15:22:00 1125
原创 用 xargs 组合命令
xargs 是个好东东,它可以将stdin作为命令的一部分 比如要删除某目录下名叫.svn的文件或目录,可以输入 find ./ -name .svn | xargs rm -rf 以此类推但是要拷贝的时候就不是那么简单了。 因为cp命令有两个参数。但是不要紧,xargs有-i/-I选项。 用法从下面的链接看到。http://www.linuxso.
2010-01-11 14:01:00 1424
原创 Optimizing Program Performance--Eliminating Unneeded Memory Reference
Memory Reference是指通过指针来读取或者写入。 这样的话肯定比直接操作寄存器要慢,而且指令数还增加了。 如: 1 /* Direct access to vector data */2 void combine3(vec_ptr v, data_t *dest)3 {4 int i;5 int length = vec_l
2010-01-09 16:58:00 831
原创 Optimizing Program Performance--Expressing relative performance
The best way to express a performance improvement is as a ratio of the form Told/Tnew, where Told is the timerequired for the original version and Tnew is the time required by the modified versi
2010-01-09 11:45:00 780
原创 Optimizing Program Performance--Reucing Procedure Calls
函数调用会增加一些overhead。调用越多对性能的影响越大。 所以要尽量减少在loop中的函数调用。 如:例子11 /* Move call to vec_length out of loop */2 void combine2(vec_ptr v, data_t *dest)3 {4 int i;5 int length = vec_
2010-01-09 11:38:00 905
原创 Optimizing Program Performance-- Eliminating Loop Inefficiencies
看下面两个函数1 /* Convert string to lower case: slow */2 void lower1(char *s)3 {4 int i;56 for (i = 0; i i++)7 if (s[i] >= ’A’ && s[i] 8 s[i] -= (’A’ - ’a’);
2010-01-09 11:07:00 838
原创 面试 Marvell
2010年1月8日,我去了张江的marvell面试。 那边貌似空气还不错。 从我家到张江地铁站果然比到公司近点,大概不到四十分钟吧。不过下了地铁站发现那边都是餐饮店,感觉有点乱。 可以想象这边晚上灯红酒绿的样子。 我随便绕了一下,找了个路牌认认路,确定了方位后,就往marvell的老巢走去了。 在科苑路上,还有点小花园,感觉挺安静的。不想刚才地铁站边上这么多人,这么多车,嘈杂和凌
2010-01-09 09:55:00 7239 1
原创 User Management的制作
前一阵子做了 盒子上的 user management的功能。 想一想 有什么经验,或者困难值得记录的呢? 我用链表来保存OldPassword,用timer来定时。 这两个都是要动态分配内存的。 所以在删除用户的时候,需要释放这部分内存。 尤其是删除用户时,需要先停止和移除定时器,否则到时候触发定时器时,就会造成crash。 因为该用户已经删除了。 比较难搞的就是如何
2010-01-08 21:25:00 1103
原创 Optimizing Program Performance-- Expressing Program Performance
We need a way to express program performance that can guide us in improving the code. A useful measurefor many programs is Cycles Per Element (CPE). 不过这个概念,我是不太清楚的。 贴个图来看看。
2010-01-08 19:51:00 779
原创 Optimizing Program Performance-- Capability and limitation of Optimizing Compilers
编译器优化代码的时候, 并不是所有的代码都可以优化的。 有下面两种情况,不能优化。 1. Memory aliasing2. function call 例子11 void twiddle1(int *xp, int *yp)2 {3 *xp += *yp;4 *xp += *yp;5 }67
2010-01-08 19:36:00 760
原创 Sequential Y86 Implementations Part III Timing
Our implementation of SEQ consists of包含了: combinational logic and two forms of memory devices: clocked registers (the program counter and condition code register), and random-access
2010-01-04 22:58:00 902
原创 Sequential Y86 Implementations Part I ISA
每条指令都涉及到了很多个操作,所以现在就是要把这些指令的执行步骤统一起来,让所有的指令都按照统一的顺序来执行。We organize them in a particularsequence of stages, attempting to make all instructions follow a uniform sequence, even though the instructio
2010-01-04 14:57:00 1171
原创 Y86 Instruction Set Architecure(ISA)
The instructions supported by a particular processor and their byte-level encodingsare known as its instruction-set architecture (ISA).Different “families” of processors, such as Intel IA32,IB
2010-01-04 14:37:00 1868
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人