AVR-GCC 4.1.2 & AVRLibC 1.4.6 benchmark by RayeR ================================================ all variables are global volatile, optimize=-O2, ATMega324P operation | clocks -------------------------------- U8=C8 3 U8=ARRAY[C8] 4 U8=ARRAY[U8] 9 U8=ARRAY[U8+C8] 9 U8=ARRAY[U8*U8+C8] 14 U8++ 5 U8+C8 5 U8+U8 7 U16++ 10 U16+C16 10 U16+U16 14 U32++ 20 U32+C32 20 U32+U32 28 U8*C8 9 U8*U8 10 U16*C16 21 U16*U16 23 U32*C32 68 U32*U32 72 U8/C8 85 U8/U8 86 U16/C8 210 U16/U8 211 U16/U16 214 U32/U8 618 U32/U16 610 U32/U32 609 U8%C8 85 U8%U8 86 U16%U8 212 U32%U16 610 U32<<8 20 U32<<16 19 U32<<24 20 U32<<5 36 U32<<13 107 U32<<28 212 for(U8) {} 10/LOOP for(U16) {} 18/LOOP for(U32) {} 34/LOOP U16=atoi("U16") 161 U32=atol("U32") 425 U16=strtoul("U16",0,16) 682 U32=strtoul("U32",0,16) 1082 sscanf_P("%c",&U8) 546 sscanf_P("%X",&U16) 975 sscanf_P("%d",&U16) 772 sscanf_P("%X",&U32) 1081 sscanf_P("%d",&U32) 882 sprintf_P("A") 351 sprintf_P("ABC") 583 sprintf_P("ABC%c",U8) 824 sprintf_P("ABC%s","DEF") 1050 sprintf_P("ABC%X",U8) 3396 sprintf_P("ABC%02X",U8) 3521 sprintf_P("ABC%d",U8) 3400 sprintf_P("ABC%X",U16) 5997 sprintf_P("ABC%04X",U16) 6122 sprintf_P("ABC%d",U16) 7329 sprintf_P("ABC%lX",U32) 10017 sprintf_P("ABC%08lX",U32) 10220 sprintf_P("ABC%ld",U32) 11290 U16=strcmp(s,"ABC") 26 U16=strcasecmp(s,"ABC") 34 U16=strncasecmp(s,"ABCD",3) 39 memset(s,100,U8) 411 memcpy(s,s+50,50) 356 ================================================ U8,16,32 = unsigned char, int, long variable C8,16,32 = unsigned char, int, long constant