It's not always as simple as that. Doing lots of if tests is also more inefficient and will require more CPU cycles because they are redundant. Many people use flags but they are redundant waste of memory and CPU cycles.
That's not much of an argument considering that these days decent processors usually start at 2.0GHZ and that is WAAAAY more than enough to handle a bunch of if statements.Matthew wrote:It's not always as simple as that. Doing lots of if tests is also more inefficient and will require more CPU cycles because they are redundant. Many people use flags but they are redundant waste of memory and CPU cycles.

That's no way to think. Also weren't we discussing PIC chips.
I thought we had gone back to console applications again. Because, personally, for console apps memory management and CPU cycles aren't bothering me because of the power of a computer. The app would have to contain lots of loops to bog down any computer (at the console level).Matthew wrote:That's no way to think. Also weren't we discussing PIC chips.

It's all relative. Powerful processors can run inefficient programs fast but you could run them even faster if they were efficient. Fast processors are no excuse to slack on software.
Well I don't purposely write terribly inefficient software. I was just saying that I don't necessarily worry my self silly over small things but often go back and fix some stuff afterwards. I'm not exactly a literal guy, but I can see the confusion.Matthew wrote:It's all relative. Powerful processors can run inefficient programs fast but you could run them even faster if they were efficient. Fast processors are no excuse to slack on software.
Oh, and I never had to use that if statement to break idea before, it was just something I thought up to counter act your point. I still don't feel it's that big of a hog though.

It adds up. If you were using loops often and there was very simple arithmetic being fone with it, the if tests could take a reasonable amount of processing time relative to everything else. It accumulates with further inefficiencies.
I think it's a good habit to avoid redundant data and processing where possible. Even if it's small, it helps the habit and can add up to make a program reasonably faster.
I think it's a good habit to avoid redundant data and processing where possible. Even if it's small, it helps the habit and can add up to make a program reasonably faster.
Well I'm sure in a situation where someone would use my provided code, a different solution could also work.Matthew wrote:It adds up. If you were using loops often and there was very simple arithmetic being fone with it, the if tests could take a reasonable amount of processing time relative to everything else. It accumulates with further inefficiencies.
Well yaMatthew wrote:I think it's a good habit to avoid redundant data and processing where possible. Even if it's small, it helps the habit and can add up to make a program reasonably faster.

Oh, and in case you skipped over it, or ignored it (


The language is weird though.
I was expecting a more robust answer from you, but yes, yes it isMatthew wrote:The language is weird though.

I think it was to teach programming to people who are more visual. Personally it screws me right up. Regardless, it's a neat language and I plan on fooling around with it a bit in case I find a solid use for me.

Why not just create a library for another language with functions like make_funky_circle()?
Me? Because I don't know how to do that. Them? I have even less of an idea.Matthew wrote:Why not just create a library for another language with functions like make_funky_circle()?

Yes, them.
My converter library has a memory leak. The leak happens constantly about 1MB a second. Since it's constantly reallocating more and more memory all the time, it slows down a lot also.
I can't get accurate readings on the performance gain vs CPython until this is sorted.
http://stackoverflow.com/questions/3840 ... realloc-im
My converter library has a memory leak. The leak happens constantly about 1MB a second. Since it's constantly reallocating more and more memory all the time, it slows down a lot also.
I can't get accurate readings on the performance gain vs CPython until this is sorted.
http://stackoverflow.com/questions/3840 ... realloc-im
A memory leak is when an allocated piece of memory isn't set free correct?

Not necessarily, it can simply be memory which is allocated too much.
In this case, that is what is happening. Something is being reallocated as it should be and is constantly growing when nothing needs to grow so much.
In this case, that is what is happening. Something is being reallocated as it should be and is constantly growing when nothing needs to grow so much.