This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

code optimization

hai,
what are the ways to reduse code.

Parents
  • "my code size is gradually increases"

    Of course, as you write more code the code size will obviously increase!

    "even though it is a small program"

    That's a prety meaningless statement!
    What do you mean by "small"?

    Are you using lots of large libraries - like printf and/or floating point?

    "when i deleting some variables from the code, size will reduses. all variables are stored in RAM, i think it should not effect the code size. but why it behaves like that."

    Well, if you don't have the variables, you presumably also remove any code that would use them - and that will obviously reduce the code size!

    Were the variables initialised? That takes code.

    "pleasse help me how to reduse the code size."

    Have you read the article yet?

    user.it.uu.se/.../engblom-esc-sf-2001.pdf

Reply
  • "my code size is gradually increases"

    Of course, as you write more code the code size will obviously increase!

    "even though it is a small program"

    That's a prety meaningless statement!
    What do you mean by "small"?

    Are you using lots of large libraries - like printf and/or floating point?

    "when i deleting some variables from the code, size will reduses. all variables are stored in RAM, i think it should not effect the code size. but why it behaves like that."

    Well, if you don't have the variables, you presumably also remove any code that would use them - and that will obviously reduce the code size!

    Were the variables initialised? That takes code.

    "pleasse help me how to reduse the code size."

    Have you read the article yet?

    user.it.uu.se/.../engblom-esc-sf-2001.pdf

Children
No data