|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Aug 2003
Location: the Retirement Home (Almost)
Posts: 1,038
|
that removes comments, spaces, new lines, ect....
I have a great PHP script but the Author may as well be writing novel with the amount of useless comments in it. hehe
__________________
The Oldest Pimp in Town |
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: Dec 2003
Location: 1123,6536,5231
Posts: 3,397
|
|
|
|
|
|
|
#3 | |
|
Confirmed User
Join Date: Aug 2003
Location: the Retirement Home (Almost)
Posts: 1,038
|
Quote:
![]()
__________________
The Oldest Pimp in Town |
|
|
|
|
|
|
#4 |
|
Confirmed User
Join Date: Dec 2003
Location: 1123,6536,5231
Posts: 3,397
|
I know... Im just being a butthead.
I don't know of one... sorry but getting you a free bump. |
|
|
|
|
|
#5 | |
|
Confirmed User
Join Date: Aug 2003
Location: the Retirement Home (Almost)
Posts: 1,038
|
Quote:
__________________
The Oldest Pimp in Town |
|
|
|
|
|
|
#6 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2003
Posts: 22,651
|
zend optimizer
|
|
|
|
|
|
#7 |
|
Confirmed User
Industry Role:
Join Date: Jan 2002
Posts: 7,981
|
Strip one line comments:
cat file.php | perl -pe 's/^\/\/.*$// > file2.php file2.php will now be stripped from one line comments Strip multi line comments: cat file2.pp | perl -pe '$/ = ""; s/\/\*.*?\*\///sm' > file3.php file3.php will now be without multi line comments Strip blank lines: cat file3.php | perl -pe 's/^\s+//' > file4.php file4.php will now be stripped from blank lines A quick and dirty one |
|
|
|
|
|
#8 | |
|
Confirmed User
Join Date: Aug 2003
Location: the Retirement Home (Almost)
Posts: 1,038
|
Quote:
__________________
The Oldest Pimp in Town |
|
|
|
|
|
|
#9 | |
|
Confirmed User
Join Date: Aug 2003
Location: the Retirement Home (Almost)
Posts: 1,038
|
Quote:
Thanks anyway, hehe
__________________
The Oldest Pimp in Town |
|
|
|
|
|
|
#10 |
|
Confirmed User
Industry Role:
Join Date: Jan 2002
Posts: 7,981
|
If you only wanna strip comments and stuff like that. That's the easiest way
|
|
|
|
|
|
#11 |
|
Will code for food...
Join Date: Apr 2001
Location: Buckeye, AZ
Posts: 8,496
|
it wouldnt make any noticable difference in the performance but its your call
__________________
|
|
|
|
|
|
#12 | |
|
Confirmed User
Join Date: May 2003
Location: look behind you
Posts: 2,477
|
Quote:
![]() |
|
|
|
|
|
|
#13 | |
|
sex dwarf
Join Date: May 2002
Posts: 17,860
|
Quote:
![]()
__________________
/(bb|[^b]{2})/ |
|
|
|
|
|
|
#14 | |
|
Confirmed User
Industry Role:
Join Date: Jan 1995
Posts: 2,417
|
Quote:
If you're worried about them effecting the performance of the scipts, you should install a PHP accelerator such as zend's or http://www.php-accelerator.co.uk/ which is free. An accelerator will compile the script and cache it. (during the compile all of the comments are ignored) However, if your script is slow, the code is the reason and those comments will help whoever works on it next. |
|
|
|
|
|
|
#15 |
|
Confirmed User
Industry Role:
Join Date: Jan 1995
Posts: 2,417
|
Removing comments from code is a TERRIBLE idea, IMO.
|
|
|
|
|
|
#16 | |
|
Confirmed User
Join Date: Nov 2003
Posts: 4,292
|
Quote:
|
|
|
|
|
|
|
#17 |
|
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 3,108
|
Like everyone else here mentioned, removing stuff like blank lines and comments causes almost no speedup. The parsing of the code, or rather stripping of newlines and comments BEFORE parsing the code is the fastest of all the compiling and executing processes.
I have to warn about php-accelerator. It is a third party product which does not really work all too well. At least I have experienced a lot of problems with it when we tried using it on a very high-trafficed site. If you REALLY think you need it, then get Zend Encoder and Zend Optimizer. To be honest, I doubt many here would really profit from php acceleration, since I _BET_ that 98% of all speed problems for most of you people here come from database and not from php problems. The best way to speed up scripts is to learn how to code and how to use mysql, and damn few people really know how to do those two. Sadly.
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right." - Charlie Munger |
|
|
|