Loading, please wait...


[ x vote for us to earn $800 each day ]

a note on speed

Posted by

Sin Vraal
(#18687) on Jan 14, 2023
calico remarked the site seems much faster...

it probably IS much faster. for a few reasons.
(technical post, dont read if you havent had coffee!)


several of the backend components have been rewritten.
1. old code for some of these components is 2-5k lines long, and used rather poor programming practices.
2. no libraries within the codebase exist, therefore there is much wasted code that is not reusable with other components on site,
3. almost the entire site is written using old old web1.0 style, and withing print "some stuff here" statements.

4. the database is ... "poorly designed", and the queries designed to pull data from it are "even more poorly designed"

what ends up happening,
1. is the web server has to compile this code every time. 5k lines of code means the script cannot be run until the 5k lines of code is compiled.
2. because each file has no shared components, these pages using very similar code (in many cases the same copy/pasted code!) have to be re compiled for each page. add a quarter second for each page on the site, and all of the sudden viewing 1000 pages results in a substantial time increase.

3. print statements can be fine when used properly, but if you print the entire page, php has to do what is called "string interpolation". this means each print statement needs to be parsed and looks for variables. this also results in difficult to modify html for the web design.

4. a badly designed database is a recipe for disaster. it can be mitigated a bit by using shared libraries. the poorly designed queries to pull the data however were murdering the speed.

what I have done so far:

I havent really even begun to construct updated pages. at this point, I am cleaning these 3 tasks.

1. streamline files. many of the sections I have re-written are 100-200 lines max. they load additional resources as required (a 5k line file doesnt typically need all the code.)

maybe by the end, 5-600 lines of code are compiled, and used.

2. many components are now shared. meaning if its cachable, its easier to gain advantage here. its also easier to update/ bugfix

3. php supports 'escaping' to regular html. when written in this way, php does not have to do "string interpolation". this results in MUCH faster code.

it also results in much CLEANER code. when the html is separate, it results in a file that can be edited by a regular web designer.

4. database queries are cleaned up whenever I see them. this is improving things a bit. but it takes a lot of time. (its also required in order to finally upgrade php version as well, since old php mysql functions are incompatible with later php versions)

anyway, this is a process. but after I've got the page mobile friendly, and a bit improved, we can get into making more features :)






View All Replies

Small addendum

Posted by

Sin Vraal
(#18687) on Jan 06, 2023
The dog remodel is taking more time than I had anticipated . This is because it’s about 10k lines of code (at least). I’m cruising through it as fast as I feel is safe. This is the heart and soul of alacrity, so every change I make has to be checked very thoroughly.

Anyhow. It’s in progress and not forgotten about :)

View All Replies

Dogs update

Posted by

Sin Vraal
(#18687) on Jan 03, 2023
I’m still working my way through dogs. Got a little sick (probably from too much pastries over xmas /new years)

Making good progress on cleanup, will post a new version when code is clean enough to do so

View All Replies


a little slow. there is A LOT of code behind the dogs page.
progress:
1. setting purchase / lease fees finished up.
2. purchasing for bones or cash is cleaned and fixed.
3. leasing / stud fee in progress as soon as I find out where it is :)

Posted on 01-6-2023 at 2:50 AM

yep, all better again. I ended up sleeping for 2 days straight. felt pretty great afterwards hehe
Posted on 01-6-2023 at 2:48 AM

I hope you get better soon!
Posted on 01-4-2023 at 2:47 PM

Login

Username:
Password:
Signup
Username: *
Password:
confirm:
Email:
Birthday:
Referrer:
  • = required field
  • two accounts per person
  • email verification necessary
  • the secret question is in case you forget your username or need to reset your email address