Well, "Space expensive" in that it can double, quadruple, or octuple a function's size which in many cases would still be absolutely fine.
Yes, I tried setting the "Favor Size or Speed" setting to...
Type: Posts; User: twinbee
Well, "Space expensive" in that it can double, quadruple, or octuple a function's size which in many cases would still be absolutely fine.
Yes, I tried setting the "Favor Size or Speed" setting to...
Huh, I thought we established that VS was ignoring the loop-unswitching optimization. Simply removing the If statement altogether shows that it does indeed run faster. I haven't gotten round to...
Just to update the situation of this problem: I have since upgraded from VS 2008 express to VS 2010 Professional and the problem still exists. Loop unswitching still isn't supported, at least judging...
Heh, I get so confused regarding GPL - I'll have to read up further. Just to be clear, when you say 'linking', I presume you mean static linking to make a giant executable which has GCC stuff in it....
GCC is GPL which means I would need to provide my own software as open source AFAIK.
Borland have a confusing license for 5.5 which mentions "nothing to be redistributed, apart from certain...
Would I be able to redistribute the Borland C/C++ compiler (their free 5.5 version) or the Microsoft C++ Visual Express compiler with my own software (which may be potentially commercial and close...
That old cookie? Can't you do better do that?
Just kidding (sorry). That is pretty advanced.
I'm kind of at the stage where I can start to do tricks like using pure malloced arrays instead of...
Thanks. Can you confirm that B would crash or produce strange output (even without any memory leak) if the program was longer? I still don't understand why it's bad though, since the variable that's...
I have 3 pieces of code below. A simple one really - just need to know which ones are safe. I think A and maybe C is safe. However, B is dangerous from my experience, but I'm not exactly sure why as...
The section of code in question I could squeeze down to only around 1-2k. I'm more than happy to use 64 or even 32 duplicates. In any case, the example code I posted in this thread could easily be...
Correct.
Within reason, I agree. Optimization if done at all should come at the end of the project. However, we're talking about code we aren't even going to see, because the compiler keeps it...
Thanks for trying to help.
You may well be right that the compiler is simply deleting the math line when I comment out the scanf line - I did consider that. But my point is that I still want to...
Internal automatic loop unswitching would be even nicer though, and I thought C++ 2008 Express would've supported that. Thanks anyway, I may end up using that technique even if only as a last resort....
itCbitC, if you mean manually coding the two loops myself, then it's impractical because maintenance would be a nightmare (my real program isn't the example above, but hundreds of lines). Any change...
There's a difference between loop unrolling and loop unswitching. Loop unswitching will only duplicate the function, one with the conditional section and one without. First though it has to prove...
Using Visual C++ 2008 (express), the following program will finish on my CPU in either 1 second or around 4 seconds according to whether the scanf("%i",&tt) line is quoted or not.
If it is...
Say I want to create a function which finds the highest number in an array of arbitrary dimension, how would I construct the parameters to receive such a variable?
I don't want to create max...
That's funny - I'm sure I tried using a looped fwrite with d[m] only, but maybe I got something else wrong.
In any case, thanks it works now!
I don't know, I'm so lucky really - if this was an...
I use the mingw compiler (with Dev-c++), but I'm wondering if this problem applies to all C compilers.
The below program crashes. However, if you set k (or l) to a lower number, say change k from...