Jump to content

Text parsing performance question


zaroundus

Recommended Posts

I was wondering if anyone could tell me what the performance issues are with parsing multiple tabs and new lines in print statements. I have a developer that uses a ton of \t metacharacters when printing in PHP and I was wondering if there were any performance issues with this.

 

Example:

print "\t\t\t\t\t\tQuery Failed.<br />\n\t\t\t\t\t\t$newsSel_q<br />\n\t\t\t\t\t\t".mysql_error()."\n";

 

There are several lines like this in every page and it really drives me crazy but I don't want to force a code change unless there is some valid reason for it. Any input would be greatly appreciated.

Link to comment
Share on other sites

I don't want to force a code change unless there is some valid reason for it.

 

How about on the grounds that it looks retarded?

 

Performance effects would be fairly minimal. The browser would be loading a larger file, so naturally there is some performance loss. As i say though, this is small. On the otherhand; I would find it a complete pain to work with that -- it's horrible on the eyes.

Link to comment
Share on other sites

The developer in question wants his final outputted HTML to be properly indented. It doesn't matter to me at all and I know that whitespace in general can cause performance hits. It is very hard to look at but I wasn't sure if the aesthetics were the only thing wrong there. Maybe I'll do some script timing and see what the actual performance dip is.

Link to comment
Share on other sites

By source code, I assume you mean HTML? How important is this--are people actively reading it? You could use a module to build the output tree, perhaps. What happens when you change the GUI--all of the tabs must be updated throughout?

Link to comment
Share on other sites

I don't want to force a code change unless there is some valid reason for it.

 

How about on the grounds that it looks retarded?

 

Sorry for the useless post, but I had to lol. :\

 

Anyways, just use css. It's the obvious answer. Unless you're making a website that is known for its source code.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.