Shop OBEX P1 Docs P2 Docs Learn Events
char faster than int? — Parallax Forums

char faster than int?

Scott MScott M Posts: 43
edited 2005-03-29 19:23 in General Discussion
I need to squeeze a few more drops of blood^H^H^H^H^H performance from my Javelins. Does anyone know if operations on char (unsigned 8 bit) are faster than operations on int (signed 16 bit) in this implementation? Most operations are stores and compares, but there is some adding and subtracting.

I can "try and see", but it means mucking a lot of code and I'm hoping someone knows definitively. Thanks.
·

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-03-29 19:23
    Write a simple test class to store and retrieve 20,000 elements

    of an array. Do that for types byte, char, short and int and time

    the operations. That should give you the answer.

    I expect the byte/char to be slightly faster because only 1 byte

    needs to stored/retrieved from the sram for each element.

    regards peter
Sign In or Register to comment.