Jump to content
MakeWebGames

Help with DB Class.


Haunted Dawg

Recommended Posts

Re: Help with DB Class.

And to those who said it will be slow? i can shove a finger in your face for that ;).

A normal game is not going to run 1000 querie's per second. Yet alone here are my result's.

 

Loading time took 0 second(s) with 23 queries.

Loading time took 0 second(s) with 203 queries.

Loading time took 0 second(s) with 2003 queries.

Loading time took 0 second(s) with 5003 queries.

Loading time took 1 second(s) with 7003 queries.

That is with running the query to select multiple row's from the database ;).

That look's good enough to me.

And with running SELECT * FROM i get this:

 

Loading time took 0 second(s) with 23 queries.

Loading time took 0 second(s) with 203 queries.

Loading time took 0 second(s) with 2003 queries.

Loading time took 1 second(s) with 4503 queries.

It start's putting time onto the page load after 4500 query's.. Pretty impresive in my eye's.

Link to comment
Share on other sites

Re: Help with DB Class.

Horrible programming techniques can run super fast, but doesn't mean they aren't horrible.

I.e., horrible and fast are not mutually exclusive.

PHP and mysql can do a lot of things in under a second. A friend of mine was running a loop a million times in a test that came in in like the hundredth/thousandths of a second.

His million iteration test however was demonstrative of a better technique and an okay technique. The speed for both was close. Nothing to make any decisions upon really. So fast code does not mean good code ;)

It's kind of like sex, if you think about it :O

Link to comment
Share on other sites

Re: Help with DB Class.

* Me think's some one has sex on there mind.. haha

 

Anyway's. You have a point there. Fast code can be horrible or good code.

Slow code can be the best code if you put your mind to it.

But as said ill stick to my method that i am currently using now and hope that nothing really bad happen's. Altho i got about 6 check's now to make sure it is secure :).

My game is again on the go now.

Thank's. Topic can be locked.

Link to comment
Share on other sites

Re: Help with DB Class.

 

But yet alone that is still good performance in my eye's.

That's all that is needed, as long as you are happy with the results :)

When it comes to db performance testing I really don't hold to much credence though. With a database there are just to many variables to consider or even cheat on (not that you did). But I've seen and participated in performance testing on databases where we sorta stacked the cards in our favor to yield the results we wanted ;)

 

Killah, we could tell you how to do what you're doing, but why would we tell you how to do something that is completely the wrong way to do it?

If you want to do something as assinine as what you're doing when the ENTIRE CE COMMUNITY is telling you it's a bad idea, then figure it out yourself, or try smarty like I said. It does have fantastic text replacement features. ;)

When I started with computers only a few colleges taught computer science and back then they wore white lab coats, not me. So I learned all my basics from books or example code I was able to get off Compuserve. Then I got a job programming in a real company and (like nyna said somewhere before) had to unlearn my hobbiest ways and code corporate. We had these code reviews and at the beginning I got my butt reamed because the "old salts" knew better and had been down that road. Course afterwords I would go back and test what method was better mine or theirs. 49 times out of 50 they were right but I had to prove it to myself. However that one time my code was better and I took it back the next time and argued the why. In the end this helped me to think outside the box when it came to code. Then I became the old salt and saw in few others the same attitude I had when I was the new guy. The ones that challenged the status quo where the ones that ended up having stellar careers in programming (theres not enough people like that in the programming field in my humble opinion, to many like floydian).

Killah code what you will, your either going to have something cool that works or you'll just have to rewrite it later. Least your learning from experience, which is the best teacher ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...