易截截图软件、单文件、免安装、纯绿色、仅160KB

Optimizing Your C/C++ Applications


C/C++ optimizing compilers are great--but there *are* a few techniques for hand-tuning your code to run as efficiently as possible on the AMD Athlon64 and Opteron processors, especially when developing DLLs, device drivers, or other performance-bound pieces of code.
Alan Zeichick  
Share |
6/21/2004 
 
Sidebar: Know the Code
A code profiler can help determine which parts of your application should be optimized. You should always use a profiler both before and after optimization to see if your change actually made an improvement—with C/C++, you can never be sure if your hand-tuning methods are better than those of your optimizing compiler!
The smart engineers at AMD have spent a lot of time identifying places where C/C++ developers can optimize code for best performance. Some of these optimizations might look familiar—they're generally great coding practice for any 32-bit or 64-bit platform or operating system. In fact, most of these suggestions are appropriate whether you're developing 32-bit or 64-bit apps. Others are specifically for 64-bit applications running on the AMD64 architecture. This article will look at six optimizations; Part 2 will examine eight more.
#1. Declare as static functions that are not used outside the file where they are defined
Declaring a function as static forces an internal linkage within that file, which can improve the performance of the code. Functions that are not declared as static default to external linkage, which may inhibit certain optimizations, such as aggressive inlining, with some C/C++ compilers.
#2: Use array notation instead of pointer notation when working with arrays
You can use either array operators ([]) or pointers to access the elements of an array. However, it's hard for the compiler to optimize pointers because the pointers are, by default, less constrained—the compiler has to assume that the pointer can read/write to any location in memory. Because array nota


相关文档:

javaSocket客户端与C服务端通信

转自:http://hi.baidu.com/ssrt_hanbing/blog/item/62e3b934598eeb82a71e1238.html
通过高低位转换。
package com.commnt;
import java.net.*;
import java.io.*;
public class Client {
public String send(String address, int port, String str) {
   OutputStream os = null;
   DataInpu ......

JAVA调用c++生成的DLL

    最近经常和公司做JAVA的兄弟们打交道,由于需要统加密算法,所以要求做一个加密的DLL文件供兄弟们调用,根据网上各位大虾们的经验,在加上个人在摸索过程中的体会,现在将流程以及个人心得贴上,以供以后漫漫程序生涯参考,如有不对的还请各位大力指正。
    第一步是编写java类, ......

理解c中的序列点

理解c中的序列点
 
 
http://blog.chinaunix.net/u1/42826/showart_364176.html
让我们来看看下面的代码:
int i=7;
printf(”%d\n”, i++ * i++);
你认为会返回什么?56?no。正确答案是返回 49?很多人会问为什么?难道不该打印出56吗?在ccfaq中有非常详尽的解释,根本原因在于c中的序列 ......

C/C++文件操作

在C++中,可以使用多种方法对文件进行操作,如基于C的文件操作、基于C++的文件操作等等;
◆基于C的文件操作
在ANSI C中,对文件的操作分为两种方式,即流式文件操作和I/O文件操作,下面就分别介绍之。
一.流式文件操作
这种方式的文件操作有一个重要的结构FILE,FILE在stdio.h中定义如下:
 typedef struct {
i ......

样例解析_C盘防毒批处理.bat

@echo off
@echo ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗
@echo ┋ 心 如 止 水 ┋
@echo ┋ ┋
@echo ┋ DIY 个 性 BAT C 盘 防 毒 批 处 理 ┋
@echo ┋ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号