SPIFI Performance hit with DEBUG vs RELEASE build settings

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SPIFI Performance hit with DEBUG vs RELEASE build settings

1,058 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fweller on Tue Mar 01 12:38:37 MST 2016
QUESTION: Why would a LPCXpresso Project run substantially slower when using SPIFI and DEBUG build vs RELEASE build.
Is there something somewhere that is disabling instruction cache or something that is causing SPIFI to be running harder under debug? 
Is this something that we can correct/compensate for?

We noticed with when test project is compiled for debug it seems to run EXTREMELY slow and we see a lot of SPIFI memory accesses where we would expect the code to be cached and not doing much at all.  When we build for release where optimization is set for size (the default), we see the code run nearly the anticipated speed and see NO SPIFI transactions during execution.  The code is a tight loop with only a couple function calls that are small.

Optimization difference: None for size

Symbols difference of DEBUG and NODEBUG respectively.

Debug compile settings
-D__MULTICORE_NONE -DDEBUG -D__CODE_RED -DCORE_M4 -D__USE_LPCOPEN -DNO_BOARD_LIB -D__LPC43XX__ -D__REDLIB__ -I"D:\proj\LPC4xxx\Code\FOXPROTestProject\lpc_chip_43xx\inc" -I"D:\proj\LPC4xxx\Code\FOXPROTestProject\lpc_chip_43xx\inc\usbd" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fsingle-precision-constant -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -specs=redlib.specs

Release compiler settings:
-D__MULTICORE_NONE -DNDEBUG -D__CODE_RED -DCORE_M4 -D__USE_LPCOPEN -DNO_BOARD_LIB -D__LPC43XX__ -D__REDLIB__ -I"D:\proj\LPC4xxx\Code\FOXPROTestProject\lpc_chip_43xx\inc" -I"D:\proj\LPC4xxx\Code\FOXPROTestProject\lpc_chip_43xx\inc\usbd" -Os -g -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fsingle-precision-constant -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -specs=redlib.specs


Original Attachment has been moved to: TestProjectArchive.zip

0 项奖励
回复
3 回复数

991 次查看
lpcware
NXP Employee
NXP Employee
bump
0 项奖励
回复

991 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue Mar 01 15:41:19 MST 2016

Quote: fweller
Is this something that we can correct/compensate for?



Try -Og: 'optimizations that do not interfere with debugging'...


0 项奖励
回复

991 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Tue Mar 01 13:05:42 MST 2016
Doesn't surprise me at all. -O0 generates very very inefficient code. It will break any caching. Take a look at what is generated to see for yourself. Take a look at the FAQs on compiler optimisation and use a higher level in your debug build, at the cost of debugability
0 项奖励
回复