Author Topic: Code optimization  (Read 15945 times)

0 Members and 1 Guest are viewing this topic.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Code optimization
« Reply #45 on: June 19, 2010, 05:03:46 pm »
Assuming you mean the speed of compiling, no.  Its only memory which I can use for something else, like the block stack.  I increased it to 100 bytes.  That should be enough for anything sane.

In case anyone is curious, these are the current stats:

Operation Stack
Max size of nested expressions such as parenthesis
100 bytes = Anywhere from 30-90ish operations.

Block Stack
Max size of nested control blocks like "If" or "While"
96 bytes = 32 blocks

Symbol Stack
Max number of variable or label names like Str1A or Lbl ZZ
750 bytes = 150 of each
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Code optimization
« Reply #46 on: June 19, 2010, 05:07:51 pm »
Mhmm, just so I understand the concept a bit more, does the stack use memory inside the compiled program (allocated during compiling) or does it uses something else in the calculator RAM? If so, then if your program doesn't use the entire stack anywhere, will it use as much memory? And would it count towards executable code or just data? Otherwise, is the stack the exact same location as with pure ASM programs?
« Last Edit: June 19, 2010, 05:08:18 pm by DJ Omnimaga »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Code optimization
« Reply #47 on: June 19, 2010, 05:10:31 pm »
I have enough free ram where I can rely totally on it and I don't have to allocate memory from the user ram.

EDIT: Just to clear confusion, this is just how the compiler works, it has nothing to do with the generated programs.
« Last Edit: June 19, 2010, 05:11:58 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Code optimization
« Reply #48 on: June 19, 2010, 05:25:53 pm »
mhmm ok, I see. I guess we don't have to worry too much, then, except maybe to not go too overboard with nesting as I described a few posts (or pages?) ago
« Last Edit: June 19, 2010, 05:26:21 pm by DJ Omnimaga »