Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 11:17 17 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Comments gobble memory...

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9080
Posted: 03:48pm 19 Dec 2013
Copy link to clipboard 
Print this post

I thought that comments using the single-quote mark are comments in the code, and as such, are ignored by the MM interpeter. While it is true they are ignored, they gobble up memory in the process.

Lesson: For big progams, you really need to keep TWO copies of the code - one with full comments to help you remember how you did things later, and another one with no comments at all. De-commenting my large menu program has saved me almost 8k of memory in Mode 4!(it had just about every line commented, to help make it easier for me to follow later, when I would have probably forgotten the details, you see)


Smoke makes things work. When the smoke gets out, it stops!
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 06:02pm 19 Dec 2013
Copy link to clipboard 
Print this post

Grogster,
If you need it to run even faster, try my Crunch program in MMLib. It will remove comments for you and compress the code, changing long names to short ones and combining lines where possible to make it even more efficient. Please note that the resulting code is almost unreadable for humans, so don't throw away your original, commented code.
Cheers,
Hugh
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9080
Posted: 06:48pm 19 Dec 2013
Copy link to clipboard 
Print this post

Sounds good, I will try that on a copy of the code.
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024