RE: [PHP] Re: Compiler for the PHP code (memecached)

2013-03-19 Thread Daevid Vincent


> -Original Message-
> From: Alessandro Pellizzari [mailto:a...@amiran.it]
> Sent: Tuesday, March 19, 2013 2:06 AM
> To: php-general@lists.php.net
> Subject: [PHP] Re: Compiler for the PHP code
> 
> Il Tue, 19 Mar 2013 08:46:22 +, Kevin Peterson ha scritto:
> 
> > My webcode written in PHP and it is running in the interpreted way. My
> > problem is it is not giving the desired performance so want to try the
> > compiler if any.
> 
> PHP gets compiled to bytecode on the server before being executed.
> You can cache the precompiled code with (for example) APC.
> Unless your code is several thousand lines of code (or your server very
> slow... 486-slow), the compilation phase is not that long.
> 
> I think your main problem can be one of:
> 
> 1- wrong algorithm
> 
> 2- long waits (database, files, network, etc.)
> 
> 3- heavy calculations
> 
> 
> Solutions:
> 
> 1- find and use a different algorithm
> 
> 2- Try to parallelize code (with gearman or similar, or via pctnl_fork)
> 
> 3- rewrite the heavy functions in C, C++ or Go and compile them, then call
> them via PHP extensions or via gearman/fork.

Another thing you can do is store both page "renders" as well as database 
results in http://memcached.org/ blobs and pull from those in intelligent ways 
(you can creatively mix and match "live" stuff with cached stuff and you can 
make pages expire in defined hours via your cache class or even a crontab).

We also add another layer in that if a blob exists in the memecached but not 
locally, we save it locally for the next hit. Depending on your hardware though 
the Gigabit/Fiber might be faster access than a local HD/SSD/RAM disk, so YMMV.

We use LAMP and our site gets > 30,000 hits per SECOND on two servers and 5 
pools.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Re: SPL Recursive Iterator Examples

2013-03-19 Thread NaMarPi


Thanks, I have heard about that feature for the first time. I will examine it.



> Why don't you post them on php.net?

> http://www.php.net/manual/add-note.php?sect=class.recursiveiterator&redirect=http://www.php.net/manual/de/class.recursiveiterator.php
>
>
>> NaMarPi  hat am 19. März 2013 um 13:01 geschrieben:
>>
>>
>>
>>
>> The usage of the examples:
>>
>> 1. the name of the php file reflects to the method(s) under consideration ->
>> find the related php.net manual page for more information
>>
>> 2. scroll down in the file, and you will find the result of the execution
>>
>>
>>
>>
>> I have not found enough documents about Recursive Iterators on the net, so
>> started to collect mini-examples here:
>>
>> https://github.com/namarpi/PHP-SPL-Recursive-Examples
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> --
> Marco Behnke
> Dipl. Informatiker (FH), SAE Audio Engineer Diploma
> Zend Certified Engineer PHP 5.3
>
> Tel.: 0174 / 9722336
> e-Mail: ma...@behnke.biz
>
> Softwaretechnik Behnke
> Heinrich-Heine-Str. 7D
> 21218 Seevetal
>
> http://www.behnke.biz/

Re: [PHP] Re: SPL Recursive Iterator Examples

2013-03-19 Thread ma...@behnke.biz
Why don't you post them on php.net?

http://www.php.net/manual/add-note.php?sect=class.recursiveiterator&redirect=http://www.php.net/manual/de/class.recursiveiterator.php


> NaMarPi  hat am 19. März 2013 um 13:01 geschrieben:
>
>
>
>
> The usage of the examples:
>
> 1. the name of the php file reflects to the method(s) under consideration ->
> find the related php.net manual page for more information
>
> 2. scroll down in the file, and you will find the result of the execution
>
>
>
>
>
>
> - Original Message -
> From: NaMarPi 
> To: "nama...@yahoo.com" 
> Cc:
> Sent: Tuesday, March 19, 2013 12:37 PM
> Subject: SPL Recursive Iterator Examples
>
>
>
>
> I have not found enough documents about Recursive iterators on the net, so
> started to colect mini-examples here:
>
> https://github.com/namarpi/PHP-SPL-Recursive-Examples
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: SPL Recursive Iterator Examples

2013-03-19 Thread NaMarPi


The usage of the examples:

1. the name of the php file reflects to the method(s) under consideration -> 
find the related php.net manual page for more information

2. scroll down in the file, and you will find the result of the execution






- Original Message -
From: NaMarPi 
To: "nama...@yahoo.com" 
Cc: 
Sent: Tuesday, March 19, 2013 12:37 PM
Subject: SPL Recursive Iterator Examples




I have not found enough documents about Recursive iterators on the net, so 
started to colect mini-examples here:

https://github.com/namarpi/PHP-SPL-Recursive-Examples

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SPL Recursive Iterator Examples

2013-03-19 Thread Alain Williams
On Tue, Mar 19, 2013 at 04:40:59AM -0700, NaMarPi wrote:
> 
> 
> I have not found enough documents about Recursive Iterators on the net, so 
> started to collect my mini-examples here:
> 
> 
> https://github.com/namarpi/PHP-SPL-Recursive-Examples

If you are putting them up as examples, then it would be good if there were
plentiful comments that said what they were supposed to do, why, how ...

Regards

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
#include 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] SPL Recursive Iterator Examples

2013-03-19 Thread NaMarPi


I have not found enough documents about Recursive Iterators on the net, so 
started to collect my mini-examples here:


https://github.com/namarpi/PHP-SPL-Recursive-Examples


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Compiler for the PHP code

2013-03-19 Thread Alessandro Pellizzari
Il Tue, 19 Mar 2013 08:46:22 +, Kevin Peterson ha scritto:

> My webcode written in PHP and it is running in the interpreted way. My
> problem is it is not giving the desired performance so want to try the
> compiler if any.

PHP gets compiled to bytecode on the server before being executed.
You can cache the precompiled code with (for example) APC.
Unless your code is several thousand lines of code (or your server very 
slow... 486-slow), the compilation phase is not that long.

I think your main problem can be one of:

1- wrong algorithm

2- long waits (database, files, network, etc.)

3- heavy calculations


Solutions:

1- find and use a different algorithm

2- Try to parallelize code (with gearman or similar, or via pctnl_fork)

3- rewrite the heavy functions in C, C++ or Go and compile them, then 
call them via PHP extensions or via gearman/fork.

Bye.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Compiler for the PHP code

2013-03-19 Thread Adam Nicholls
Checkout HipHop by the Facebook guys, it turns PHP into C code and compiles 
down to binary. 

...although I don't think it's for the faint hearted.

Have you tried other optimisation techniques first - eg Caching, and 
Profiling?? If this is a production environment you might wanna think about 
increasing resources or introducing a load balancer (in the case of PHP based 
websites)

Cheers
Ads.


Sent from my BlackBerry® wireless device

-Original Message-
From: Camille Hodoul 
Date: Tue, 19 Mar 2013 09:52:14 
To: Kevin Peterson
Cc: 
Subject: Re: [PHP] Compiler for the PHP code
Googling "compile php code" gave me this :
http://stackoverflow.com/questions/1408417/can-you-compile-php-code
It looks like you have some options but I haven't tried any yet, so I can't
help you with the installation


2013/3/19 Kevin Peterson 

> My webcode written in PHP and it is running in the interpreted way. My
> problem is it is not giving the desired performance so want to try the
> compiler if any.
> Please suggest if we have any compiler option available for the PHP code
> and more important is this new option.
>
>


-- 
Camille Hodoul
http://camille-hodoul.com/



Re: [PHP] Compiler for the PHP code

2013-03-19 Thread Vincent Tumwijukye
Dear Kevin, please install and use the PECL bcompiler extension. You will
need to use the approprate version for your php

regards

On Tue, Mar 19, 2013 at 11:46 AM, Kevin Peterson wrote:

> My webcode written in PHP and it is running in the interpreted way. My
> problem is it is not giving the desired performance so want to try the
> compiler if any.
> Please suggest if we have aany compiler option available for the PHP code
> and more important is this new option.
>
>


-- 
Tumwijukye Vincent
Chief Executive Officer
Future Link Technologies
Plot 78 Kanjokya Street,
P. O. BOX 75408,
KAMPALA - UGANDA
Tel: +256(0)774638790
Off:+256(0)41531274
Website: www.fl-t.com, www.savingsplus.info


Re: [PHP] Compiler for the PHP code

2013-03-19 Thread Camille Hodoul
Googling "compile php code" gave me this :
http://stackoverflow.com/questions/1408417/can-you-compile-php-code
It looks like you have some options but I haven't tried any yet, so I can't
help you with the installation


2013/3/19 Kevin Peterson 

> My webcode written in PHP and it is running in the interpreted way. My
> problem is it is not giving the desired performance so want to try the
> compiler if any.
> Please suggest if we have any compiler option available for the PHP code
> and more important is this new option.
>
>


-- 
Camille Hodoul
http://camille-hodoul.com/


[PHP] Compiler for the PHP code

2013-03-19 Thread Kevin Peterson
My webcode written in PHP and it is running in the interpreted way. My problem 
is it is not giving the desired performance so want to try the compiler if any. 
Please suggest if we have any compiler option available for the PHP code and 
more important is this new option.