profiling in vc6 ... 没vtune....vc7 玩不了

来源:互联网 发布:淘宝店铺退货流程 编辑:程序博客网 时间:2024/04/27 02:18

游戏开发才是真正把机器用到极的过程,要不是执行3d,我怎么也不会用到 profiling ..  做 java 民工活的时候,更是连数据结构都无视了全部 arraylist... 现代软件过程很多时候被滥用.... 以至机器性能全被垃圾代码吃了,扯远了...

pfofile  d9的  d3d的 fog 的 demo

profile   shadow  volume

因为要动态生成 一个 楞柱
所以可以看到 生成点和 修改 mesh的时间才是最多的
GXTri3Mesh 
 但是意外的是写字原来,CD3DFont::DrawTextA 居然这么耗时间..

断点只是编写局部debug用,只看那个的话 只见树木不见森林 

vc7 以上居然不带 profile 功能......虽然说vc6的 也不是很直观,但是有好过没有啊 vtune 又贵又要钱啊,(虽然严格来说vc的话也是很贵的...但是...咳咳  只能找 emule 帮忙了....) 


 Profile: Function timing, sorted by time
Date:    Fri Nov 24 19:33:22 2006

Program Statistics
------------------
    Command line at 2006 Nov 24 19:33: "C:/DXSDK/Samples/C++/Direct3D/StencilBuffer/ShadowVolume/Debug/ShadowVolume"
    Total time: 4048.641 millisecond
    Time outside of functions: 89.314 millisecond
    Call depth: 18
    Total functions: 3523
    Total hits: 10329712
    Function coverage: 10.0%
    Overhead Calculated 1172
    Overhead Average 1172

Module Statistics for shadowvolume.exe
--------------------------------------
    Time in module: 3959.326 millisecond
    Percent of time in module: 100.0%
    Functions in module: 3523
    Hits in module: 10329712
    Module function coverage: 10.0%

        Func          Func+Child           Hit
        Time   %         Time      %      Count  Function
---------------------------------------------------------
    1145.773  28.9     1145.773  28.9   658248 AddEdge(unsigned short *,unsigned long &,unsigned short,unsigned short) (shadowvolume.obj)
     735.916  18.6      735.916  18.6     6561 GXTri3Mesh<unsigned short,1,65535>::DrawSubset(unsigned long) (createmesh.obj)
     315.969   8.0      315.969   8.0      729 ShadowVolume::Render(struct IDirect3DDevice9 *) (shadowvolume.obj)
     262.673   6.6      336.278   8.5     1458 CD3DFont::DrawTextA(float,float,unsigned long,char const *,unsigned long) (d3dfont.obj)
     193.635   4.9     1754.965  44.3      729 ShadowVolume::BuildFromMesh(struct ID3DXMesh *,struct D3DXVECTOR3) (shadowvolume.obj)
     139.300   3.5      139.300   3.5  3090210 D3DXVECTOR3::D3DXVECTOR3(float,float,float) (d3dfont.obj)
     135.937   3.4     3320.531  83.9      729 CD3DApplication::Render3DEnvironment(void) (d3dapp.obj)
     135.284   3.4      142.822   3.6     1358 CD3DApplication::MsgProc(struct HWND__ *,unsigned int,unsigned int,long) (d3dapp.obj)
     132.082   3.3      222.113   5.6  1978984 D3DXVECTOR3::operator-(struct D3DXVECTOR3 const &) (d3dutil.obj)
     114.158   2.9      209.622   5.3        2 _D3DXLoadMeshFromXA@32 (loadx.obj)
      66.671   1.7      115.775   2.9  1110016 D3DXVECTOR3::operator*(float) (shadowvolume.obj)
      55.151   1.4       55.527   1.4        9 DXUtil_FindMediaFileCch(char *,int,char *) (dxutil.obj)
      36.719   0.9     3502.864  88.5        1 CD3DApplication::Run(void) (d3dapp.obj)
      30.028   0.8       43.894   1.1   434716 D3DXVec3Cross(struct D3DXVECTOR3 *,struct D3DXVECTOR3 const *,struct D3DXVECTOR3 const *) (d3dutil.obj)
      28.440   0.7       28.585   0.7       22 GXTri3Mesh<unsigned short,1,65535>::Resize(unsigned int,unsigned int) (createmesh.obj)
      28.322   0.7       28.322   0.7   902626 D3DXVECTOR3::D3DXVECTOR3(void) (d3dfont.obj)
      25.616   0.6       56.275   1.4   336372 InitFont2DVertex(struct D3DXVECTOR4 const &,unsigned long,float,float) (d3dfont.obj)
      25.235   0.6      376.146   9.5        1 CD3DApplication::Initialize3DEnvironment(void) (d3dapp.obj)
      22.527   0.6       22.527   0.6      232 _D3DXQuaternionMultiply@12 (d3dxmath.obj)
      20.706   0.5       20.706   0.5      729 CMyD3DApplication::DrawShadow(void) (shadowvolume.obj)
      20.084   0.5      439.750  11.1        1 CD3DApplication::Create(struct HINSTANCE__ *) (d3dapp.obj)
      19.745   0.5       19.745   0.5   434716 D3DXVec3Dot(struct D3DXVECTOR3 const *,struct D3DXVECTOR3 const *) (d3dutil.obj)
      19.074   0.5       20.634   0.5        7 D3DXTex::CImage::LoadBMP(void const *,unsigned long) (cimage.obj)
      17.330   0.4       17.330   0.4   336376 D3DXVECTOR4::D3DXVECTOR4(float,float,float,float) (d3dfont.obj)
      16.615   0.4       30.659   0.8   336372 FONT2DVERTEX::FONT2DVERTEX(void) (d3dfont.obj)
      15.645   0.4       36.279   0.9        7 D3DXTex::CImage::Load(void const *,unsigned long,struct _D3DXIMAGE_INFO *,int) (cimage.obj)
      14.190   0.4       42.215   1.1       16 _D3DXCreateMesh@24 (createmesh.obj)
      14.043   0.4       14.043   0.4   336372 D3DXVECTOR4::D3DXVECTOR4(void) (d3dfont.obj)
      13.322   0.3       95.457   2.4       30 LoadMeshes(struct IDirectXFileData *,struct D3DXMATRIX &,unsigned long,struct IDirect3DDevice9 *,struct ID3DXMesh * *,struct ID3DXBuffer * *,struct ID3DXBuffer * *,struct ID3DXBuffer * *,unsigned long *) (loadx.obj)
      12.703   0.3       27.358   0.7       11 GXTri3Mesh<unsigned short,1,65535>::OptimizeInternal(unsigned long,unsigned long const *,unsigned long *,unsigned long *,struct ID3DXBuffer * *,struct IDirect3DVertexBuffer9 *,struct _D3DVERTEXELEMENT9 const *) (createmesh.obj)
      12.338   0.3       12.338   0.3        1 _Direct3DCreate9@4 (d3d9.dll)
      11.841   0.3       74.485   1.9        9 D3DXLoadMeshFromXofEx(struct IDirectXFileData *,unsigned long,struct IDirect3DDevice9 *,struct ID3DXBuffer * *,struct ID3DXBuffer * *,struct ID3DXBuffer * *,unsigned long *,struct ID3DXMesh * *,unsigned char * *,unsigned long *,struct ID3DXBuffer * *,struct ID3DXBuffer * *,class CBone * *,unsigned long *,struct IDirectXFileData * * *,unsigned long *) (loadx.obj)
      10.394   0.3     3959.100 100.0        1 _WinMain@16 (shadowvolume.obj)
       9.756   0.2        9.756   0.2        3 CD3DFont::PaintAlphabet(struct HDC__ *,int) (d3dfont.obj)
       8.111   0.2        8.111   0.2     1664 D3DXTex::CCodec_X8R8G8B8::Encode(unsigned int,unsigned int,struct D3DXCOLOR *) (ccodec.obj)
       5.763   0.1        7.068   0.2        1 CD3DApplication::Cleanup3DEnvironment(void) (d3dapp.obj)
       5.378   0.1     1420.825  35.9      729 CMyD3DApplication::Render(void) (shadowvolume.obj)
       5.122   0.1        5.606   0.1        1 CD3DApplication::CD3DApplication(void) (d3dapp.obj)
       4.752   0.1        4.752   0.1     1664 D3DXTex::CCodec_P8::Decode(unsigned int,unsigned int,struct D3DXCOLOR *) (ccodec.obj)
       4.272   0.1      740.188  18.7     1458 CD3DMesh::Render(struct IDirect3DDevice9 *,bool,bool) (d3dfile.obj)
       3.554   0.1       55.719   1.4        7 CreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *,void const *,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned long,enum _D3DFORMAT,enum _D3DPOOL,unsigned long,unsigned long,unsigned long,struct _D3DXIMAGE_INFO *,struct tagPALETTEENTRY *,enum _D3DRESOURCETYPE,struct IDirect3DBaseTexture9 * *) (d3dx9tex.obj)
       2.969   0.1     1761.139  44.5      729 CMyD3DApplication::FrameMove(void) (shadowvolume.obj)
       2.675   0.1        2.675   0.1    59998 FindEdge(unsigned long const *,unsigned long) (loadx.obj)
       2.521   0.1        2.521   0.1     2190 DXUtil_Timer(enum TIMER_COMMAND) (dxutil.obj)
       2.308   0.1      318.277   8.0      729 CMyD3DApplication::RenderShadow(void) (shadowvolume.obj)
       2.119   0.1        4.293   0.1        1 `vector constructor iterator'(void *,unsigned int,int,void (*)(void *)) (shadowvolume.obj)
       2.032   0.1        4.265   0.1       38 CheckAdjacency(unsigned long const *,unsigned long) (loadx.obj)
       1.971   0.0        3.979   0.1      739 _D3DXMatrixMultiply@12 (d3dxmath.obj)
       1.876   0.0        4.019   0.1    30834 CSimVertexCache<unsigned short,65535>::AccessVertex(unsigned short,bool &) (createmesh.obj)
       1.816   0.0        1.816   0.0    30834 CIndexQueue<unsigned short,65535>::BElementPresent(unsigned short) (createmesh.obj)
       1.634   0.0       11.402   0.3        1 CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *) (d3dfont.obj)
       1.560   0.0        1.560   0.0        7 D3DXTex::CImage::LoadDIB(void const *,unsigned long) (cimage.obj)
       1.478   0.0        1.478   0.0       22 GXTri3Mesh<unsigned short,1,65535>::~GXTri3Mesh<unsigned short,1,65535>(void) (createmesh.obj)
       1.456   0.0        3.547   0.1        9 GXConvertPointRepsToAdjacency<unsigned short,65535>(struct IDirect3DVertexBuffer9 *,struct IDirect3DIndexBuffer9 *,unsigned long,unsigned int,unsigned int,struct _D3DXATTRIBUTERANGE *,unsigned int,unsigned long const *,unsigned long *,unsigned int) (createmesh.obj)
       1.429   0.0        1.910   0.0        1 CD3DEnumeration::EnumerateDevices(struct D3DAdapterInfo *,class CArrayList *) (d3denumeration.obj)
       1.262   0.0        2.007   0.1        1 _D3DXCpuOptimizations@4 (cpudetect.obj)
       1.019   0.0       11.242   0.3        2 GXTri3Mesh<unsigned short,1,65535>::StripReorder(unsigned long,unsigned int *,unsigned int *,unsigned long const *) (createmesh.obj)
       1.018   0.0       25.211   0.6     1358 CD3DArcBall::HandleMouseMessages(struct HWND__ *,unsigned int,unsigned int,long) (d3dutil.obj)
       0.961   0.0        1.266   0.0     9435 GXTri3Mesh<unsigned short,1,65535>::CcwCorner(struct SFaceCorner &,class CMeshStatus<unsigned short,1,65535> *) (createmesh.obj)
       0.931   0.0        1.075   0.0        4 CD3DMesh::Destroy(void) (d3dfile.obj)
       0.882   0.0        6.521   0.2        2 GXTri3Mesh<unsigned short,1,65535>::VCacheStripReorder(class CMeshStatus<unsigned short,1,65535> *,unsigned int *,unsigned int *,unsigned long,unsigned long) (createmesh.obj)
       0.851   0.0        2.855   0.1        1 CD3DEnumeration::Enumerate(void) (d3denumeration.obj)
       0.822   0.0        0.822   0.0     5481 _D3DXVec3Normalize@8 (d3dxmath.obj)
       0.759   0.0        0.759   0.0      246 _sqrtf (d3dutil.obj)
       0.759   0.0      169.303   4.3     1358 WndProc(struct HWND__ *,unsigned int,unsigned int,long) (d3dapp.obj)
       0.739   0.0        0.739   0.0      759 GXTri3Mesh<unsigned short,1,65535>::LockVertexBuffer(unsigned long,void * *) (createmesh.obj)
       0.727   0.0        0.727   0.0    23175 CMeshStatus<unsigned short,1,65535>::BProcessed(unsigned short) (createmesh.obj)
       0.684   0.0        1.190   0.0     4324 CMeshStatus<unsigned short,1,65535>::DecrementCount(unsigned short) (createmesh.obj)
       0.664   0.0        0.664   0.0     2718 GXTri3Mesh<unsigned short,1,65535>::SwapVertex(unsigned int,unsigned int,unsigned char *) (createmesh.obj)
       0.648   0.0        0.648   0.0    10278 GXTri3Mesh<unsigned short,1,65535>::RemapFace(unsigned int,unsigned int *,unsigned int *) (createmesh.obj)
       0.637   0.0      168.570   4.3     1358 CMyD3DApplication::MsgProc(struct HWND__ *,unsigned int,unsigned int,long) (shadowvolume.obj)
       0.636   0.0        1.561   0.0      160 `vector constructor iterator'(void *,unsigned int,int,void * (*)(void *)) (d3dx9tex.obj)
       0.635   0.0        0.637   0.0       55 D3DXTex::mmx_BoxFilter2D_A8R8G8B8(unsigned int *,unsigned int *,unsigned int,unsigned int,unsigned int,unsigned int) (cblt.obj)
       0.633   0.0        0.633   0.0     5221 HashFind(unsigned long,unsigned long,unsigned long,struct hashentry * *,unsigned long,unsigned long,unsigned char *,unsigned long) (createmesh.obj)
       0.596   0.0        0.596   0.0      729 _D3DXMATRIXA16::operator=(struct D3DXMATRIX const &) (d3dfile.obj)
       0.585   0.0        0.585   0.0      759 GXTri3Mesh<unsigned short,1,65535>::UnlockVertexBuffer(void) (createmesh.obj)
       0.538   0.0        0.538   0.0     5057 HashRemove(unsigned long,unsigned long,unsigned long,struct hashentry * *,unsigned long) (createmesh.obj)
       0.537   0.0        1.571   0.0      729 CD3DApplication::UpdateStats(void) (d3dapp.obj)
       0.518   0.0        0.580   0.0       11 GXTri3Mesh<unsigned short,1,65535>::AttributeSort(unsigned int *,unsigned int *,unsigned int *,unsigned long) (createmesh.obj)
       0.507   0.0        0.507   0.0    33408 D3DXCOLOR::D3DXCOLOR(void) (d3dx9tex.obj)
       0.503   0.0        4.797   0.1        1 CMyD3DApplication::OneTimeSceneInit(void) (shadowvolume.obj)
       0.480   0.0       30.534   0.8       11 GXTri3Mesh<unsigned short,1,65535>::OptimizeInplace(unsigned long,unsigned long const *,unsigned long *,unsigned long *,struct ID3DXBuffer * *) (createmesh.obj)
       0.478   0.0        0.491   0.0       22 GXTri3Mesh<unsigned short,1,65535>::GXTri3Mesh<unsigned short,1,65535>(struct IDirect3DDevice9 *,struct _D3DVERTEXELEMENT9 const *,unsigned long) (createmesh.obj)
       0.474   0.0        0.822   0.0      729 D3DUtil_InitLight(struct _D3DLIGHT9 &,enum _D3DLIGHTTYPE,float,float,float) (d3dutil.obj)
       0.465   0.0        0.465   0.0       34 CD3DXCrackDecl::CD3DXCrackDecl(void) (crackdecl.obj)
       0.445   0.0        0.445   0.0        1 sse2_D3DXInitFastTable(struct D3DXFASTTABLE *) (ssefasttable2.obj)
       0.390   0.0        0.390   0.0     7750 CMeshStatus<unsigned short,1,65535>::PrependElement(unsigned short) (createmesh.obj)
       0.390   0.0        1.966   0.0     3426 CMeshStatus<unsigned short,1,65535>::MarkAsProcessed(unsigned short) (createmesh.obj)
       0.379   0.0        0.379   0.0     7750 CMeshStatus<unsigned short,1,65535>::RemoveElement(unsigned short) (createmesh.obj)
       0.375   0.0        0.375   0.0        9 DXUtil_GetDXSDKMediaPathCch(char *,int) (dxutil.obj)
       0.341   0.0        0.341   0.0        7 D3DXCore::CFile::~CFile(void) (cfile.obj)
       0.336   0.0        0.336   0.0      729 _D3DXMatrixInverse@12 (d3dxmath.obj)
       0.329   0.0        2.962   0.1        4 GXTri3Mesh<unsigned short,1,65535>::CalculateMissRate(unsigned int *,unsigned int *,unsigned int *,unsigned long) (createmesh.obj)
       0.329   0.0        0.329   0.0      759 GXTri3Mesh<unsigned short,1,65535>::LockIndexBuffer(unsigned long,void * *) (createmesh.obj)
       0.327   0.0        0.327   0.0    11624 CIndexQueue<unsigned short,65535>::InsertElement(unsigned short) (createmesh.obj)
       0.325   0.0        0.345   0.0        1 CMyD3DApplication::FinalCleanup(void) (shadowvolume.obj)
       0.312   0.0        1.004   0.0     1716 SVertexCopyContext::CopyVertex(unsigned int,unsigned int,int) (loadx.obj)
       0.310   0.0        0.310   0.0        7 D3DXCore::CFile::Open(void const *,int) (cfile.obj)
       0.305   0.0        0.305   0.0     8247 FindEdge(unsigned short const *,unsigned short) (createmesh.obj)
       0.305   0.0        1.108   0.0       11 GXTri3Mesh<unsigned short,1,65535>::ReorderVertexData(unsigned int *,unsigned char *) (createmesh.obj)
       0.277   0.0        0.277   0.0     2772 _D3DXVec3TransformCoord@12 (d3dxmath.obj)
       0.269   0.0        1.136   0.0       13 GXTri3Mesh<unsigned short,1,65535>::ReorderFaceData(unsigned int *,unsigned int *) (createmesh.obj)
       0.265   0.0       61.506   1.6        9 SetMesh(struct SLoadedFace * &,unsigned long,struct SLoadVertex * &,unsigned long,struct SCorner *,unsigned long,struct SFVFData *,struct SDeclData *,int,unsigned long *,unsigned long,struct _D3DVERTEXELEMENT9 * const,struct IDirect3DDevice9 *,struct ID3DXMesh * *,struct ID3DXBuffer * *) (loadutil.obj)
       0.250   0.0        0.375   0.0        9 InitVertices(struct SLoadVertex * &,unsigned long) (loadutil.obj)
       0.249   0.0        3.317   0.1        1 GXGenerateAdjacency<unsigned short,65535>(struct IDirect3DVertexBuffer9 *,struct IDirect3DIndexBuffer9 *,struct _D3DVERTEXELEMENT9 const *,unsigned long,unsigned int,unsigned int,struct _D3DXATTRIBUTERANGE *,unsigned int,float,unsigned long *) (createmesh.obj)
       0.249   0.0        1.062   0.0      246 CD3DArcBall::ScreenToVector(int,int) (d3dutil.obj)
       0.248   0.0        0.551   0.0        2 _D3DXComputeNormals@8 (createmesh.obj)
       0.244   0.0        0.373   0.0     3432 CD3DXCrackDecl::Encode(struct _D3DVERTEXELEMENT9 const *,unsigned int,float const *,unsigned int) (crackdecl.obj)
       0.243   0.0        0.243   0.0      729 CD3DArcBall::GetRotationMatrix(void) (shadowvolume.obj)
       0.241   0.0        0.241   0.0      729 ShadowVolume::Reset(void) (shadowvolume.obj)
       0.237   0.0        0.318   0.0     3432 CD3DXCrackDecl::Decode(struct _D3DVERTEXELEMENT9 const *,unsigned int,float *,unsigned int) (crackdecl.obj)

原创粉丝点击