Multos Forums

   

Performance tips

RankRankRank

Total Posts: 74

Joined 2012-02-21

PM

Please post any tips you have on optimisation of MULTOS applications here.

To start the ball rolling, here are a couple.

Use of RAM
If you have application variables that you modify intensively, the best place to put them is in RAM. In MULTOS that means either using automatic variables (i.e. created on the stack) or placing variables in session memory (using the #melsession pragma). If the amount of such data is too big to fit in RAM or needs to be static, it may still be worth having a RAM scratch-pad that you can copy subsets of data into to work on.

EEPROM Page Alignment
Try and make sure that the static variables in your application that you need to update DO NOT cross a page boundary, as this increases the number of EEPROM write operations required at a low level. The beginning of static memory is page aligned but the page size varies depending on the underlying chip. This ranges from 256 bytes down to 32 bytes, but all are a multiple of 32 bytes.

     
RankRankRank

Total Posts: 74

Joined 2012-02-21

PM

If you need to clear a block of memory, use multosBlockClear() rather than memset(). This works for up to 255 byte buffer and is a single MEL instruction so is much quicker.