Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some optimization hints...
#31
Quote:Excuse me, Mr. 1000101, but I was replying to the post above mine, from a forum user very disgusted about your opinions regarding PureQB that said something in the likes of "you're nothing 'cuz I've never seen any code from you since I'm on this forum". Therefore, I jumped with "some research" to help this guy out, but some moderator found these aseverations a bit too harsh, and thus removed the post. Hence, the announce below...

hrm...I'm not exactly sure the tone in which that openning comment was made. I'll not make any comment on it other then that the 'Mr.' makes it sound a little like sarcasm, but the rest of the statement is ambiguous enough in tone to make me wonder.
Life is like a box of chocolates', hrm, WTF, no it isn't, more like, 'life is like a steaming pile of horse crap.'
Reply
#32
LOL. Sorry, but I have that nasty custom of being a bit polite with people that I don't know their "style" of conversation. (ie: I don't have idea if you'll kick my bollicks if I call you "bastard", "niggah" or "bruddah" -- yep, that's my stupid so-called "style"...)

Unfortunately I couldn't save the now missing post of Mango for further analysis. So the best thing we can do is to forget everything and keep going. Thus...

MODERATORS: 1 -- REBELS: 0

Moral of the story: There's no place for discussions on a discussion board.
img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
Reply
#33
Quote:in the end, sooner or later, we learn these facts by experience. so your research was incredibly useful... for the people that didn't knew that
Ohh, did you know that x*x*x was faster then x^3?

And ofcourse you use x+x instead of x*2, knowing + is faster?

Not many people do, noone I've asked actually.


*Smacks Hexadecimal Disaster*


And I'm a Crazed Berzerk Swede, but the image was too big to have as an avatar, thus the evil smiley. Here is how I "really" look:
[Image: CBSZ!re.jpg]


Btw, Rice and curry chicken... yum! =) *eating it, with sticks, yeay, I'm so weird*




EDIT: Credits to Zap for making the pic.
Reply
#34
Z!re that conan-like pic is not gonna last against Hex with a pet-bottle coke in hand. ;*)

Hex: Still busy with the singing stint?

Anmd yes Mario, *real* crucifixion is a yearly matter here. I live on a city 20 miles off the Tal-Tal.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#35
i could reply to this if i want to, but it seems kinda pointless. we've both made our points: i think i'll just leave it as it is. No sense continuing this debate. I'm a bit tired of it. Being grabbed by the throat about ten minutes ago didn't exactly help. Smile I apologize for overreacting.
Jumping Jahoolipers!
Reply
#36
Back on the subject of optimization...

LINE (0, 0) - (319, 199, 0, BF

Is faster then

CLS

In mode 13h.

Personally, I don't like mode 13h, but...
Life is like a box of chocolates', hrm, WTF, no it isn't, more like, 'life is like a steaming pile of horse crap.'
Reply
#37
writing tight code and finding efficient way to accomplish some task is an interesting part of programming....and a big part of QB programming.

It's interesting that the mantra from the C++ forums can be summed as follows:

Use efficient algorithms. Write code that's easy to follow, and that works, and do not attempt to optimize. Then...compile using an optimizing compiler. If you still have bottle-necks, optimize only the bottle-necks.

This perspective is from professional programmers who are trying to minimize the time required to develop projects, while making maintainance of the code easy as possible.

When I first started messing with c++, I did a lot of fiddling to determine if, dereferencing pointers was faster than using indexed arrays, or if calling swap() was slower than swapping manually...and I basically determined that the answer depends on your compiler and optimization settings. And when there is a speed difference, it is often quite (vanishingly) small.

Anyway...here are a few optimizations I have found useful (in addition to the ones already mentioned).
______________
Try to make logic statements check if a variable "is or ain't" rather than if it has some particular value

for example (using integers, of course):

x=0
do
x=x+1
loop while x < 100

is slower than:

x=100
do
x=x-1
loop while x
_____

white-space; extra lines; long variable names; indentation; comments slows down QB. It shouldn't, but it does. I have decided to never use this form of optimization, because it generally makes the code harder to follow.
__________

Avoid floating points for critical variables....eg variables that are inside loops. Never use floating point variables as the counter in a for/next loop.
__________
to erase a point,

preset(x,y)

is faster than

pset(x,y),0
________________
learn to use Boolean logic...you can sometimes get rid of large conditional blocks with the clever use of a few bitwise/logical operators and simple arithmatic.
_____________
Reply
#38
Quote:...makes some sense in this context. I decided to leave my reply untouched because I wanted to make a point. (and because I know that big brother can use his mighty powers to eradicate anything evil and/or not useful. Wink)

The "big brother" you refer to is me. Mango's post was way out of line, violating the user agreement he agreed to when signing up here and general netiquette among other things. Note a few points however: 1) I didn't lock the topic; 2) I didn't ban anyone; 3) I posted a clarification post to make sure everyone knew what had happened. So in effect, now everyone knew that mango had posted something bad, without 1000101 counterattacking and starting a flame war.

Quote:For barok & oracle: true, very true, but what can you do if someone doesn't respect that and attacks you? To start crying like a brat? To ask big bro to use his almighty power of anesthesia upon us and lock the topic/ban anyone/whatever?

You've got mail (shortly).
Reply
#39
Quote:Mango's post was way out of line, violating the user agreement he agreed to when signing up here and general netiquette among other things.

In my own defence, I've been a somewhat regular participant here who has not looked for controversy. I've tried to be polite and helpful, in general. However, on the particular night when I made my "way out of line" post, I had a bit of ethanol in my system and when I read the following by 1000101:
Code:
Maybe if you don't explicitly declare variables and what type they are, but only bad coders do this. You're not a bad coder, are you? ;P
---
Who the hell uses that @£^$-ass mode?
---
PQBers are retarded ass-monkeys who need to learn how to code.
---
I wouldn't call anyone who is a PQB ass-monkey a 'great coder'.
---
Most of them suck ass.
...well...I thought that the rudeness deserved a reply in kind. Anyway...sorry that Oracle has taken so much flak in this thread...

Cheers
Reply
#40
Hmm...I didn't know that long variable names slow QB down. I knew that it affected GWBasic, but I read somewhere that in QB, it doesn't matter once you compile.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)