Performance: F("string") in a function


nosing around performance tweaks ran following:

2 performance related pieces of info:

1.  f("string")  -    stores string in flash, , calls there when needed instead of storing in ram
2. after function runs, ram used function released , available again program.


if understand correct;:


the following a  simplified example missing bits.


void printstring(){
lcd.print(f("hello world"));
}

void loop(){
printstring();
}



would waste of flash space ?
or f() usage here still giving performance gain ?   (though little may in example)


looking @ given performance information, think if not use f() here, "hello world" string used when function called.

or, function loaded memory @ start up; , not use f(),  bloat program total ram usage because of strings ? 

both function , string in flash.
there no particular performance gain (possibly loss), you're not wasting precious ram constant string.


Arduino Forum > Using Arduino > Programming Questions > Performance: F("string") in a function


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support