1
wizanda
Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 12:58

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


This is on overall development of anything on the web, when we reduce the size of file, we reduce its reading time, so gaps and


Extra spaces

In sentences

Makes not much sense, as you see

.



So overall and as I am doing for my own site, I have in my CSS files made them look like this:


.item{stuff: lots;users: many;}
.CSS of theme{faster: yes;server load: lower;}
.Etc{}

And so on, one it is easier to read then a long lists as many bits of software do for no reason, if you can find CSS and JavaScript packers, smaller is better.


So JavaScript also as that last full stop is about, on it own line?

Its not just XOOPS its design software to be easier to read, yet we are making tons of unnecessary space in the process, and in fact it is harder to read.

Which do you find easier:

Function {has something here explain{ the function and closes here}}


Or a bigger list of function{
The stuff
Goes here{ and
Here
}
}

To me the one of a single lines is far easier to read in many cases and so it is for a browser.

It is also very pretty with indents, yet we can remove all indents from any file again saving pauses in space reading.
It may be a computer and it may not be exactly as we are, yet it still has to read a space.

So you can have pretty looking shapes in code or you can have a fast none sluggish super system with pretty looking shapes in graphics, me personally would like the super system for all of us.

2
jeffgr
Re: Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 14:20

  • jeffgr

  • Quite a regular

  • Posts: 263

  • Since: 2004/2/22


Hi Wizanda,

First, I want to thank you for your efforts in speeding up the XOOPS code... I have been reading your threads with interest, and your work is going to help all of us in the end.

I found this page, which does talk about changing the way CSS files are formatted, and other tips on increasing page speed:

http://www.evolt.org/article/10_new_ways_to_speed_up_download_time/20/60294/

The comments below the article are interesting to read as well.

Regarding the removing of the spaces from the CSS file, do you have any idea how much this speeds up the page loading? How are you testing this, or is this just your general observation? (which is ok, by the way, I just want to know). I am asking this because I "prefer" to see my CSS indented, as I find it slightly easier to understand this way. Do you find that removing the spaces from CSS files is worth the effort?

Thanks,

Jeff

3
skenow
Re: Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 14:46

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


Here's a simple comparison of equivalent stylesheets -
html {
    
background-colorGray;
    
background-imageurl(images/logo.jpb);
    
background-repeatno-repeat;
    
background-positioncenter;
    
background-attachmentfixed;
}

The above is 172b

html {background-colorGraybackground-imageurl(images/logo.jpb); background-repeatno-repeatbackground-positioncenterbackground-attachmentfixed;}

The above is 159b

html {backgroundGray url(images/logo.jpgno-repeat center fixed;}

The above is 68b!

html {
    
backgroundGray url(images/logo.jpgno-repeat center fixed;
}

This is 73b

While indenting does create larger files (longer times to load), abbreviating definitely saves more space.

4
wizanda
Re: Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 15:11

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


I first thank you for the interest (nice to know) it makes me feel it is all worth while.

Ok I have been tidying all day and yesterday in terms of doing this and have noticed a major difference.
When something has JS and it is slow, it is noticeable from the drag as a browser can only download a certain number of files at the same time, and as I am using all Js for most block and features, it sort of drags before fixing these.

Also just edited sessions.php with all its pretty extra lines and mainfile.php, still leaving the instructions just removing so many blank lines in-between, that also reduced file size and so read speed.

Time for a spring cleaning of Xoops....

With less spaces: CSS is more speed overall noticeable, JavaScript is directly noticeable, PHP handles better.


5
JMorris
Re: Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 15:13

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Best tool I've found for optimizing your CSS. I use it regularly.

Warning: The header graphic on the following site is um... suggestive. (may not be appropriate for minors)

http://flumpcakes.co.uk/css/optimiser/

In spite of the header graphic, I think it is a fantastic tool for speeding up your CSS.

Another cool trick is using Dreamweaver to remove line breaks in your HTML.

I don't release themes in the most optimum state because end users would have a fit trying to figure the code out. However, for those who know enough to want to optimize, the above tools will save you much time.
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

6
davidl2
Re: Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 15:29

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


That's the problem... if the code was released in that form, it would make things hard for people to customise it for their own uses....

7
wizanda
Re: Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 15:35

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


The plan is For it to be easier not as confusing, yet get the point we can find online systems to do this, yet we as a community system like you just mentioned need to have it readable.

Well for me personally and from looking at cleaned up CSS and JSS in this fashion of lines, make more sense and reads faster, I ask all XOOPS module developers etc, to reduce space in all files, else I will later for everyone.
Yet in the purpose of having a completely streamlined system that is still easier on the eyes to look at.
A full CSS file in 'lines' instead of its many breaks, is easier to scan read as a file and see what you are looking for.
JS closed properly is easier, and with an explanation above as can be done with all, is far easier if all of it is compact, the longer a file is In extra reading the harder it is for all of us looking for what we need later.
So I am in the process of doing my whole site, CBB and Articles included, CBB already in CSS and JS done and noticeable improvement.

Quote:

Please don't think i mean scrabbled EGG by online systems, mean by hand still easy, just get rid of like half of XOOPS unwanted wasted space.

8
davidl2
Re: Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 15:37

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


James or Wizanda - how tricky is it to "strip" the spacing automatically on a load of files? Is that possible?

9
wizanda
Re: Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 15:41

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


As for your question there is a plug-in for Smarty called Jstrip, which will remove blank spaces from Javascript, yet really this is another server load and so i removed it after experimenting.
Decided it is better done by hand for all of us

Also did try gziping JS and CSS, yet also this can cause errors if not done right….

So first is clean then pollish

10
JMorris
Re: Stripping Xoops of unwanted Spaces, will increase speed
  • 2007/3/16 16:26

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


To be completely honest, I disagree with the use of JavaScript for rendering all HTML. This is a misuse of client side scripting and does not follow best practices. That's just my opinion, we don't need to debate it. Misuse or not, it would work.

IMHO, what would be better would be to reduce the code volume and to format the code better. This cannot be done as quickly and it would require that Devs and Designers learn how to code more efficiently.

In the short-term, yes, much can be gained by doing things mentioned in this thread. However, in the long-term, it would be much better to remove the source of the problem rather than putting a bandaide on it.

Just my 2 cents.
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

Login

Who's Online

215 user(s) are online (126 user(s) are browsing Support Forums)


Members: 0


Guests: 215


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits