趣味+メモ用のブログです。
GNU/Linux関連、OSS関連情報、調査事項になるでしょうが、何を書くか分かりません。
× [PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
nintendo-dsエミュレータである「desmume-0.9.6」の高速化について調査。
■ソース場所 http://sourceforge.net/projects/desmume/ から取得。(0.9.6) ■パフォーマンス測定 gprofを使って調べたところ、以下のような結果に
--------------------------------------------------------------------------------------Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
17.87 1.98 1.98 86528811 0.00 0.00 unsigned int armcpu_exec<0>()
8.03 2.87 0.89 7630027 0.00 0.00 std::pair<int, int> armInnerLoop<true, true>(unsigned long long, int, int, int)
7.40 3.69 0.82 121944 0.01 0.01 void RasterizerUnit<true>::runscanlines<false>(edge_fx_fl*, edge_fx_fl*, bool)
6.68 4.43 0.74 215634 0.00 0.00 void renderline_textBG<false>(GPU*, unsigned short, unsigned short, unsigned short)
5.14 5.00 0.57 13307193 0.00 0.00 unsigned int OP_LDR_P_IMM_OFF<0>(unsigned int)
4.24 5.47 0.47 273 1.72 39.74 void NDS_exec<false>(int)
3.88 5.90 0.43 85447599 0.00 0.00 T1ReadLong_guaranteedAligned(unsigned char*, unsigned int)
3.61 6.30 0.40 7630299 0.00 0.00 Sequencer::execHardware()
2.35 6.56 0.26 102540 0.00 0.01 GPU_RenderLine_layer(NDS_Screen*, unsigned short)
1.71 6.75 0.19 1546298 0.00 0.00 unsigned int OP_STMDB_W<0>(unsigned int)
1.53 6.92 0.17 21687 0.01 0.01 MemSpan::memcmp(void*, int)
1.44 7.08 0.16 3712813 0.00 0.00 void FetchADPCMData<(SPUInterpolationMode)1>(channel_struct*, int*)
1.35 7.23 0.15 2043530 0.00 0.00 unsigned int OP_LDRH_P_IMM_OFF<0>(unsigned int)
1.35 7.38 0.15 886233 0.00 0.00 void ___SPU_ChanUpdate<2, (SPUInterpolationMode)1>(bool, SPU_struct*, channel_struct*)
1.26 7.52 0.14 9316652 0.00 0.00 unsigned int armcpu_exec<1>()
1.17 7.65 0.13 3649263 0.00 0.00 unsigned int OP_CMP_IMM_VAL<0>(unsigned int)
1.17 7.78 0.13 ExposeDrawingArea(_GtkWidget*, _GdkEventExpose*, void*)
1.08 7.90 0.12 42816 0.00 0.00 void GPU::_spriteRender<(GPU::SpriteRenderMode)0>(unsigned char*, unsigned char*, unsign
ed char*, unsigned char*)
0.99 8.01 0.11 1795737 0.00 0.00 unsigned int OP_LDMIA_W<0>(unsigned int)
0.99 8.12 0.11 186558 0.00 0.00 execsqrt()
0.90 8.22 0.10 3141612 0.00 0.00 unsigned int OP_CMP_LSL_IMM<0>(unsigned int)
0.90 8.32 0.10 2 50.00 50.00 GPU_InitFadeColors()
0.81 8.41 0.09 4017368 0.00 0.00 unsigned int OP_MOV_LSL_IMM<0>(unsigned int)
0.81 8.50 0.09 3552284 0.00 0.00 unsigned int OP_STR_P_IMM_OFF<0>(unsigned int)
0.72 8.58 0.08 2768975 0.00 0.00 gfx3d_sendCommandToFIFO(unsigned int)
0.72 8.66 0.08 1787255 0.00 0.00 unsigned int OP_AND_IMM_VAL<0>(unsigned int)
0.72 8.74 0.08 652845 0.00 0.00 SetVertex()
0.63 8.81 0.07 4497928 0.00 0.00 Adhoc_usTrigger()
0.63 8.88 0.07 120 0.58 0.58 SoftRasterizerEngine::initFramebuffer(int, int, bool)
0.54 8.94 0.06 7418877 0.00 0.00 NDS_RescheduleGXFIFO(unsigned int)
0.54 9.00 0.06 4214488 0.00 0.00 _MMU_ARM9_write32(unsigned int, unsigned int)
0.45 9.05 0.05 5865898 0.00 0.00 unsigned int OP_B<0>(unsigned int)
0.45 9.10 0.05 5489484 0.00 0.00 T1ReadLong_guaranteedAligned(unsigned char*, unsigned int)
0.45 9.15 0.05 869006 0.00 0.00 unsigned int OP_STRH_P_IMM_OFF<0>(unsigned int)
0.45 9.20 0.05 288666 0.00 0.00 unsigned int OP_LDMIA<0>(unsigned int)
0.45 9.25 0.05 166992 0.00 0.00 unsigned int OP_STMIA<0>(unsigned int)
0.36 9.29 0.04 4497927 0.00 0.00 WIFI_usTrigger()
0.36 9.33 0.04 3043834 0.00 0.00 unsigned int OP_BX<0>(unsigned int)
0.36 9.37 0.04 2800787 0.00 0.00 _MMU_ARM9_read32(unsigned int)
0.36 9.41 0.04 2546110 0.00 0.00 unsigned int OP_MOV_IMM_VAL<0>(unsigned int)
0.36 9.45 0.04 2465196 0.00 0.00 gfx3d_execute(unsigned char, unsigned int)
0.36 9.49 0.04 1206105 0.00 0.00 unsigned int OP_SUB_S_IMM_VAL<0>(unsigned int)
0.36 9.53 0.04 1031575 0.00 0.00 unsigned int OP_B<1>(unsigned int)
0.36 9.57 0.04 832355 0.00 0.00 unsigned int OP_ORR_IMM_VAL<0>(unsigned int)
0.36 9.61 0.04 435252 0.00 0.00 unsigned int OP_LDRB_M_IMM_OFF_PREIND<0>(unsigned int)
0.36 9.65 0.04 22341 0.00 0.01 DmaController::doCopy()
0.36 9.69 0.04 120 0.33 0.33 void SoftRasterizerEngine::performViewportTransforms<false>(int, int)
0.27 9.72 0.03 4415367 0.00 0.00 setIF(int, unsigned int)
0.27 9.75 0.03 3326322 0.00 0.00 GFX_PIPErecv(unsigned char*, unsigned int*)
0.27 9.78 0.03 2465196 0.00 0.00 GFX_FIFOsend(unsigned char, unsigned int)
0.27 9.81 0.03 1746976 0.00 0.00 unsigned int OP_ORR_LSL_IMM<0>(unsigned int)
0.27 9.84 0.03 1633516 0.00 0.00 unsigned int OP_AND_S_IMM_VAL<0>(unsigned int)
0.27 9.87 0.03 1559382 0.00 0.00 armcpu_switchMode(armcpu_t*, unsigned char)
0.27 9.90 0.03 1251504 0.00 0.00 unsigned int OP_MRS_CPSR<0>(unsigned int)
0.27 9.93 0.03 991869 0.00 0.00 unsigned int OP_AND_LSL_IMM<0>(unsigned int)
0.27 9.96 0.03 890318 0.00 0.00 _MMU_ARM9_read16(unsigned int)
0.27 9.99 0.03 829811 0.00 0.00 unsigned int OP_BIC_IMM_VAL<0>(unsigned int)
0.27 10.02 0.03 658484 0.00 0.00 ClipperPlane<1, -1, ClipperPlane<1, 1, ClipperPlane<2, -1, ClipperPlane<2, 1, ClipperOut
put> > > >::clipVert(bool, VERT*)
0.27 10.05 0.03 232003 0.00 0.00 void GFX3D_Clipper::clipPoly<true>(POLY*, VERT**)
0.27 10.08 0.03 226254 0.00 0.00 unsigned int OP_STMIA_W<0>(unsigned int)
0.27 10.11 0.03 179374 0.00 0.00 unsigned int OP_LDR_M_IMM_OFF<0>(unsigned int)
0.27 10.14 0.03 139529 0.00 0.00 unsigned int OP_STRH_P_IMM_OFF<1>(unsigned int)
0.27 10.17 0.03 72071 0.00 0.00 SPU_MixAudio(bool, SPU_struct*, int)
0.27 10.20 0.03 21940 0.00 0.01 TexCacheItem* TexCache::scan<(TexCache_TexFormat)2>(unsigned int, unsigned int)
0.18 10.22 0.02 3391599 0.00 0.00 unsigned int OP_ADD_IMM_VAL<0>(unsigned int)
0.18 10.24 0.02 3072330 0.00 0.00 unsigned int OP_BL<0>(unsigned int)
0.18 10.26 0.02 2419545 0.00 0.00 gfx3d_ysort_compare(int, int)
0.18 10.28 0.02 1427405 0.00 0.00 unsigned int OP_ADD_LSL_IMM<0>(unsigned int)
0.18 10.30 0.02 743446 0.00 0.00 unsigned int OP_MOV_LSL_IMM<1>(unsigned int)
0.18 10.32 0.02 691424 0.00 0.00 unsigned int OP_LDRB_P_IMM_OFF<0>(unsigned int)
0.18 10.34 0.02 624551 0.00 0.00 _MMU_ARM7_write32(unsigned int, unsigned int)
0.18 10.36 0.02 508937 0.00 0.00 unsigned int OP_MOV_ASR_IMM<0>(unsigned int)
0.18 10.38 0.02 495594 0.00 0.00 gfx3d_glVertex3_cord(unsigned int, unsigned int, unsigned int)
0.18 10.40 0.02 444124 0.00 0.00 unsigned int OP_CMP_LSL_IMM<1>(unsigned int)
0.18 10.42 0.02 319073 0.00 0.00 unsigned int OP_ADD_IMM_VAL<1>(unsigned int)
0.18 10.44 0.02 297889 0.00 0.00 unsigned int OP_BX<1>(unsigned int)
0.18 10.46 0.02 274262 0.00 0.00 unsigned int OP_BL<1>(unsigned int)
0.18 10.48 0.02 262192 0.00 0.00 unsigned int OP_LDMIA_W<1>(unsigned int)
0.18 10.50 0.02 169058 0.00 0.00 unsigned int OP_MOV_S_LSL_IMM<0>(unsigned int)
0.18 10.52 0.02 60072 0.00 0.01 void RasterizerUnit<true>::shape_engine<false>(int, bool)
0.18 10.54 0.02 25936 0.00 0.00 unsigned int OP_LDRSH_P_REG_OFF<1>(unsigned int)
0.18 10.56 0.02 17404 0.00 0.00 unsigned int OP_STMIB2_W<0>(unsigned int)
0.18 10.58 0.02 111 0.18 0.31 void std::__introsort_loop<int*, int, bool (*)(int, int)>(int*, int*, int, bool (*)(int,
int))
-------------------------------------------------------------------------------------- ●上記で気になるのは呼び出しが多い関数 armcpu_exec<0>() と T1ReadLong_guaranteedAligned() はずば抜けて 呼び出し回数が多い。 INLINE化することにより高速化できないかと検討 ■結果 とあるROMにて 20fps->19fpsに高速化を確認 ■ソース http://sakaihdt.gozaru.jp/desmume.html PR |
カレンダー
カテゴリー
フリーエリア
最新コメント
最新記事
(05/02)
(01/25)
(01/15)
(12/04)
(12/01)
最新トラックバック
ブログ内検索
最古記事
(02/21)
(07/12)
(07/12)
(07/18)
(07/20) |