PHP target questions

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

PHP target questions

Elsass Philippe
Hello,

I've been looking into the PHP target and I'm a bit anxious by the
output: tons of PHP classes.

I suppose index.php is going to require all the generated classes and
I'm worried it might be pretty heavy in the long run - you know, PHP
being this dog when it comes to performance...

--
Philippe

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

basvanmeurs
Hi Elsass,

I've made several production and heavy-loaded websites using the PHP target and I can tell you: the performance is good. Much better than Drupal-driven websites for instance.

The PHP target will only load the classes that are needed at run time, which is much more efficient than most standard PHP scripts, which have a 'include' statement at the top of the file. Even better, it happens automatically because the Haxe PHP target does this work for you.

The granularity is a blessing rather than a problem in this respect, as PHP can only load code per-file.

Regards,
Bas
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

MarcWeber
In reply to this post by Elsass Philippe
Excerpts from Elsass Philippe's message of Fri Jul 08 10:20:19 +0200 2011:
> I suppose index.php is going to require all the generated classes and
Think about it. How can you find out? Should be trivial.

If no way comes to your mind write again and I'll tell you about at
least 3 different ways.

Marc Weber

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

Elsass Philippe
In reply to this post by Elsass Philippe
Thanks Bas,

I was precisely worried it would just require everything, but as you
suggest I found in the generated code that it's using the PHP classes
loading feature so it looks like it's going to be efficient no matter
how many classes you have.

Philippe

On Fri, Jul 8, 2011 at 12:00 PM,  <[hidden email]> wrote:

> Send Haxe mailing list submissions to
>        [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.motion-twin.com/mailman/listinfo/haxe
> or, via email, send a message with subject or body 'help' to
>        [hidden email]
>
> You can reach the person managing the list at
>        [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Haxe digest..."
>
>
> Today's Topics:
>
>   1. Re: ScreenWeaver HX samples not compiling, crashing neko
>      (Axel Huizinga)
>   2. closest thing to stuff like Knockout.js in haxe? (Raoul Duke)
>   3. Re: Re: Xml.parse throws Null Function Pointer error in cpp
>      (Gamehaxe)
>   4. Re: Re: Xml.parse throws Null Function Pointer error in cpp
>      (Alex Liebert)
>   5. NME cookie problem (Joshua Harlan Lifton)
>   6. PHP target questions (Elsass Philippe)
>   7. Re: PHP target questions (basvanmeurs)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 07 Jul 2011 23:08:05 +0200
> From: Axel Huizinga <[hidden email]>
> Subject: Re: [haXe] ScreenWeaver HX samples not compiling, crashing
>        neko
> To: The haXe compiler list <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Am 07.07.2011 19:35, schrieb Alex Liebert:
>> Hey Ido,
>>
>> I don't have the project in front of me, but if I recall the API had
>> changed but the samples weren't updated.  Can you try creating a
>> simple app based on the latest haxe.org doc and building it without
>> using run?
>>
>> Alex
>>
>> On Thu, Jul 7, 2011 at 4:26 AM, Ido Yehieli<[hidden email]>  wrote:
>>> Hi,
>>> I'm trying to use ScreenWeaver HX to create a desktop application with haxe
>>> (using the flash target).
>>>
>>> Going via http://haxe.org/com/libs/swhx, I installed swhx with "haxelib
>>> install swhx", but when running it with "haxelib run swhx" I get the
>>> following error:
>>> ----
>>> C:\Users\ido>haxelib run swhx
>>> Run.hx:11: buidling Sampler application - please hold.
>>> C:\Motion-Twin\haxe\lib\swhx/1,2,0/swhx/Plugin.hx:93: characters 14-31 :
>>> haxe.#H
>>> ttp has no field request
>>> Run.hx:27: running Sampler application.
>>> Run.hx:29: done
>>> ----
>>>
>>> After correcting Plugin.hx by changing line 93 from "var data =
>>> haxe.Http.request(url);" to "var data = haxe.Http.requestUrl(url);" and
>>> uncaught exception popup appears with the text:
>>> ----
>>> Uncaught exception
>>> load.c(176) : Module not found : app.n
>>> ----
>>>
>>> On the console I get:
>>> ----
>>> C:\Users\ido>haxelib run swhx
>>> Run.hx:11: buidling Sampler application - please hold.
>>> Sample.hx:77: characters 29-32 : Local variable cmd used without being
>>> initializ
>>> ed
>>> Run.hx:27: running Sampler application.
>>> Run.hx:29: done
>>> ----
>>>
>>> When further investigating, I tried running and compiling the 1st
>>> sample(http://pastebin.com/SNVidGHR):
>>> ----
>>> C:\Motion-Twin\haxe\lib\swhx\1,2,0\samples\1-basic>haxe compile.hxml
>>>
>>> C:\Motion-Twin\haxe\lib\swhx\1,2,0\samples\1-basic>neko app.n
>>> ----
>>>
>>> Neko crashes immediately. Commenting the lines one by one revealed that line
>>> 34 ("flash.start();") is the cause of neko crashing.
>>>
>>> Any idea about what I'm doing wrong or how to solve the problem?
>>>
>>> Thanks,
>>> Ido.
>>>
>>> --
>>> View this message in context: http://haxe.1354130.n2.nabble.com/ScreenWeaver-HX-samples-not-compiling-crashing-neko-tp6557976p6557976.html
>>> Sent from the Haxe mailing list archive at Nabble.com.
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
> Just tried to rebuild an older test I did with swhx and first run into
> trouble because it crashes on my XP box
>  with the current player (10.3.181.34 - NOT the debug version)
> First I tried to use the automatic download of swhx but failed because
> Adobe no longer provides xpi packages...
> Fortunately I found an 10,1,102,64 build which works well...
> Included with a little test application at
> http://go2ghana.net/flashDevel/SwhxDevel.zip
>
> Any ideas why the current version doesn't work?
> There is a dump of the crash if anyone is interested.
>
> Cordially,
> Axel
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 7 Jul 2011 16:47:38 -0700
> From: Raoul Duke <[hidden email]>
> Subject: [haXe] closest thing to stuff like Knockout.js in haxe?
> To: The haXe compiler list <[hidden email]>
> Message-ID:
>        <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> what is everybody's favourite declarative gui haxe lib?
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 08 Jul 2011 08:02:44 +0800
> From: Gamehaxe <[hidden email]>
> Subject: Re: [haXe] Re: Xml.parse throws Null Function Pointer error
>        in cpp
> To: "The haXe compiler list" <[hidden email]>
> Message-ID: <op.vx9w2uud2w6r7u@weave>
> Content-Type: text/plain; charset=iso-8859-15; format=flowed;
>        delsp=yes
>
> Hi,
> I been trying some io stuff from android, and there
> seems to be a problem when the ndll throws an exception
> (or maybe any exception).  I will have to look into this more.
> I notice there is an ndkr5c - hopefully this will solve some
> problems, although it is more likely to create others.
>
> Hugh
>
>> I need help :)
>>
>> Any other suggestions?  Seems like it should be in std.dll.  Std.dll
>> is in the directory of the app and is freshly built (this is Windows,
>> which I'm back on after having the problem on iOS.)  I think I need
>> some kind of logging for the dll loading but not sure how to enable
>> it...since the parse function is stubbed in the haxe code but the
>> implementation is supposed to come from the dll right?
>>
>> Thank you in advance!!
>>
>> Alex
>>
>> On Wed, Jul 6, 2011 at 5:34 PM, Alex Liebert <[hidden email]>
>> wrote:
>>> (guessing that the timestamp is the same, stupid me.)  Anything else i
>>> can do to debug the xml parse problem?
>>>
>>> Thanks,
>>>
>>> Alex
>>>
>>> On Wed, Jul 6, 2011 at 5:26 PM, Alex Liebert
>>> <[hidden email]> wrote:
>>>> thank you.
>>>>
>>>> what does 'no need' mean?
>>>>
>>>>  no need:
>>>> c:/dev/svn.googlecode/nme//ndll/Windows/nme.ndll(1.309994299e+012) < b
>>>> in/cpp/Windows/Ommnme/nme.ndll (1.3099953e+012)
>>>>
>>>> On Wed, Jul 6, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:
>>>>> Hi,
>>>>> Just quickly - you can use the "-v" verbose flag to the install-toool
>>>>> to see
>>>>> where files are getting copied from.
>>>>>
>>>>> Hugh
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 7 Jul 2011 17:07:46 -0700
> From: Alex Liebert <[hidden email]>
> Subject: Re: [haXe] Re: Xml.parse throws Null Function Pointer error
>        in cpp
> To: The haXe compiler list <[hidden email]>
> Message-ID:
>        <CACbjBy_J9yFjgZ9WECq1cvJn5-u=[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Thanks Hugh.  Let me know when there's something new I should try.
>
> Not sure if it's related to android, that's where I get the io error
> (building libs) but this problem is for windows target (with the
> xml.parse problem.)
>
> Alex
>
> On Thu, Jul 7, 2011 at 5:02 PM, Gamehaxe <[hidden email]> wrote:
>> Hi,
>> I been trying some io stuff from android, and there
>> seems to be a problem when the ndll throws an exception
>> (or maybe any exception).  I will have to look into this more.
>> I notice there is an ndkr5c - hopefully this will solve some
>> problems, although it is more likely to create others.
>>
>> Hugh
>>
>>> I need help :)
>>>
>>> Any other suggestions?  Seems like it should be in std.dll.  Std.dll
>>> is in the directory of the app and is freshly built (this is Windows,
>>> which I'm back on after having the problem on iOS.)  I think I need
>>> some kind of logging for the dll loading but not sure how to enable
>>> it...since the parse function is stubbed in the haxe code but the
>>> implementation is supposed to come from the dll right?
>>>
>>> Thank you in advance!!
>>>
>>> Alex
>>>
>>> On Wed, Jul 6, 2011 at 5:34 PM, Alex Liebert <[hidden email]>
>>> wrote:
>>>>
>>>> (guessing that the timestamp is the same, stupid me.)  Anything else i
>>>> can do to debug the xml parse problem?
>>>>
>>>> Thanks,
>>>>
>>>> Alex
>>>>
>>>> On Wed, Jul 6, 2011 at 5:26 PM, Alex Liebert <[hidden email]>
>>>> wrote:
>>>>>
>>>>> thank you.
>>>>>
>>>>> what does 'no need' mean?
>>>>>
>>>>>  no need:
>>>>> c:/dev/svn.googlecode/nme//ndll/Windows/nme.ndll(1.309994299e+012) < b
>>>>> in/cpp/Windows/Ommnme/nme.ndll (1.3099953e+012)
>>>>>
>>>>> On Wed, Jul 6, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:
>>>>>>
>>>>>> Hi,
>>>>>> Just quickly - you can use the "-v" verbose flag to the install-toool
>>>>>> to see
>>>>>> where files are getting copied from.
>>>>>>
>>>>>> Hugh
>>>>>>
>>>>>> --
>>>>>> haXe - an open source web programming language
>>>>>> http://haxe.org
>>>>>>
>>>>>
>>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 7 Jul 2011 23:20:23 -0400
> From: Joshua Harlan Lifton <[hidden email]>
> Subject: [haXe] NME cookie problem
> To: The haXe compiler list <[hidden email]>
> Message-ID:
>        <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi all,
>
> I'm trying to use the new getCookies() method of nme.net.URLLoader,
> but the returned array is always empty when it shouldn't be. When
> using a browser or a curl command line, the cookie I'm looking for
> shows up as expected. I see from the web server logs that the cookie
> is always returned in the Set-cookie header as it should be, but
> URLLoader.getCookies() is always empty. I looked at the underlying
> CURL.cpp code, and it looks fine as well. I added a printf in the
> function that copies cookies from libcurl to NME, but it never gets
> called, which is consistent with libcurl not knowing about any
> cookies. I thought this might be due to the curl cookie engine not
> being enabled, but I see that the engine is enabled as it should be in
> the CURLLoader constructor. Any other ideas on what to try? Is the
> URLLoader functionality known to work against some test?
>
> Thanks,
> Josh
>
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 8 Jul 2011 10:20:19 +0200
> From: Elsass Philippe <[hidden email]>
> Subject: [haXe] PHP target questions
> To: [hidden email]
> Message-ID:
>        <CAM5fAf7ieBy5aKp1EuCtFTXJQbkE=[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello,
>
> I've been looking into the PHP target and I'm a bit anxious by the
> output: tons of PHP classes.
>
> I suppose index.php is going to require all the generated classes and
> I'm worried it might be pretty heavy in the long run - you know, PHP
> being this dog when it comes to performance...
>
> --
> Philippe
>
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 8 Jul 2011 02:47:50 -0700 (PDT)
> From: basvanmeurs <[hidden email]>
> Subject: [haXe] Re: PHP target questions
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Elsass,
>
> I've made several production and heavy-loaded websites using the PHP target
> and I can tell you: the performance is good. Much better than Drupal-driven
> websites for instance.
>
> The PHP target will only load the classes that are needed at run time, which
> is much more efficient than most standard PHP scripts, which have a
> 'include' statement at the top of the file. Even better, it happens
> automatically because the Haxe PHP target does this work for you.
>
> The granularity is a blessing rather than a problem in this respect, as PHP
> can only load code per-file.
>
> Regards,
> Bas
>
> --
> View this message in context: http://haxe.1354130.n2.nabble.com/PHP-target-questions-tp6561708p6561925.html
> Sent from the Haxe mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> _______________________________________________
> Haxe mailing list
> [hidden email]
> http://lists.motion-twin.com/mailman/listinfo/haxe
>
>
> End of Haxe Digest, Vol 69, Issue 35
> ************************************
>



--
Philippe

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

MarcWeber
The only thing being horribly inefficient is using funtions containing
closures..

I guess this could be fixed by using PHP 5.3s lambas to some extend.

Marc Weber

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

Baluta Cristian
Maybe the --dead-code-elimination will clean correctly what you don't use.

On Fri, Jul 8, 2011 at 5:06 PM, Marc Weber <[hidden email]> wrote:
The only thing being horribly inefficient is using funtions containing
closures..

I guess this could be fixed by using PHP 5.3s lambas to some extend.

Marc Weber

--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

Franco Ponticelli
There is a little known trick to squeeze out some performance gain with haXe/PHP; create a "cache" directory at the same level of "lib" and give it the proper read/write access. Doing that the Boot class will cache the available types instead of parsing the directory tree. If you have many many types you will probably gain something like 10% in speed. The only drawback is that you will have to delete the cache file each time you add/remove types.

Franco

On Fri, Jul 8, 2011 at 8:49 AM, Baluta Cristian <[hidden email]> wrote:
Maybe the --dead-code-elimination will clean correctly what you don't use.


On Fri, Jul 8, 2011 at 5:06 PM, Marc Weber <[hidden email]> wrote:
The only thing being horribly inefficient is using funtions containing
closures..

I guess this could be fixed by using PHP 5.3s lambas to some extend.

Marc Weber

--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

MarcWeber
In reply to this post by Baluta Cristian
Excerpts from Baluta Cristian's message of Fri Jul 08 16:49:12 +0200 2011:
> Maybe the --dead-code-elimination will clean correctly what you don't use.

My statements were based on these tests:
https://github.com/MarcWeber/haxe-iterator-like

results are here:
http://mawercer.de/~marc/bench2/

results for PHP are quite ok.. But if you start returning functions
accesing vars in scope of the parent function performance is nowhere
comparable to all the other backends.

And that all has nothing to do with dropping unused code.

Marc Weber

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

Franco Ponticelli
At some point I will probably add new features from php 5.3 and php 6 ... I am just not sure how much performance we will gain with that.

Franco

On Fri, Jul 8, 2011 at 10:23 AM, Marc Weber <[hidden email]> wrote:
Excerpts from Baluta Cristian's message of Fri Jul 08 16:49:12 +0200 2011:
> Maybe the --dead-code-elimination will clean correctly what you don't use.

My statements were based on these tests:
https://github.com/MarcWeber/haxe-iterator-like

results are here:
http://mawercer.de/~marc/bench2/

results for PHP are quite ok.. But if you start returning functions
accesing vars in scope of the parent function performance is nowhere
comparable to all the other backends.

And that all has nothing to do with dropping unused code.

Marc Weber

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

Elsass Philippe
In reply to this post by Elsass Philippe
@Mark
I don't know PHP enough to determine what PHP classes are actually
loaded, if that's what you mean :)

However I figured that it wasn't an issue so that's cool.

@Franco
I saw the code about the cache in Boot.php and I'll probably give it a
go when the app will be stable.


BTW, I'd ask 2 other questions while I have your attention ;)

1. what do you use for deployment? just FTP the whole /lib? might take
forever to upload everything on each build.

2. although I'm far from having the need for it atm, I'm curious about
caching strategies (ie. memcached & stuff) - what is the easiest
option?

Cheers,
Philippe

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

MarcWeber
Excerpts from Elsass Philippe's message of Fri Jul 08 20:28:27 +0200 2011:
> @Mark
> I don't know PHP enough to determine what PHP classes are actually
> loaded, if that's what you mean :)

Ways to find out what's going on:

a)
delete a php class file you don't use when generating a page.
If requires were used there should be an error

b) edit the PHP files containing a class. Add your own trace lines
(echo, var_export, throw,...) lines there. If they are executed hte file
has been sourced by the PHP interpreter

c) use a debugger

d) use php xdebug trace all lines

....

In any case it looks like you've found the autoload code loading classes
lazily. (PHP still is much slower than neko..)


> 1. what do you use for deployment? just FTP the whole /lib? might take
> forever to upload everything on each build.

You can use git -> ftp scripts which only transfer differences.
However you're much luckier using a server which support SSH login and
thus scp etc.

If nothing else work you can do crazy things and upload a zip file and
make PHP download and unpack the zip (thus updating the codebase)..

This takes some more time to setup though.

> 2. although I'm far from having the need for it atm, I'm curious about
> caching strategies (ie. memcached & stuff) - what is the easiest
> option?
use xdebug and do some profiling. Then you know *what* to cache.
There is no general answer to your question. Because haxe supports
everything PHP supports you can use sqlite databases or files or ...

PHP is a pig: Either you get speed or maintainable code - never both.
Live with it or switch target language.
(You can still get your job done)

Marc Weber

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

Franco Ponticelli
I agree with Marc on everything. About the caching strategies there are hooks for that in ufront but I've not implemented any module/filters for that so far. I use Neko on production and not PHP and so far I've not felt the need for caching (lately I am not doing much server side development and certainly not on big projects).

Franco

On Fri, Jul 8, 2011 at 12:43 PM, Marc Weber <[hidden email]> wrote:
Excerpts from Elsass Philippe's message of Fri Jul 08 20:28:27 +0200 2011:
> @Mark
> I don't know PHP enough to determine what PHP classes are actually
> loaded, if that's what you mean :)

Ways to find out what's going on:

a)
delete a php class file you don't use when generating a page.
If requires were used there should be an error

b) edit the PHP files containing a class. Add your own trace lines
(echo, var_export, throw,...) lines there. If they are executed hte file
has been sourced by the PHP interpreter

c) use a debugger

d) use php xdebug trace all lines

....

In any case it looks like you've found the autoload code loading classes
lazily. (PHP still is much slower than neko..)


> 1. what do you use for deployment? just FTP the whole /lib? might take
> forever to upload everything on each build.

You can use git -> ftp scripts which only transfer differences.
However you're much luckier using a server which support SSH login and
thus scp etc.

If nothing else work you can do crazy things and upload a zip file and
make PHP download and unpack the zip (thus updating the codebase)..

This takes some more time to setup though.

> 2. although I'm far from having the need for it atm, I'm curious about
> caching strategies (ie. memcached & stuff) - what is the easiest
> option?
use xdebug and do some profiling. Then you know *what* to cache.
There is no general answer to your question. Because haxe supports
everything PHP supports you can use sqlite databases or files or ...

PHP is a pig: Either you get speed or maintainable code - never both.
Live with it or switch target language.
(You can still get your job done)

Marc Weber

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

Elsass Philippe
In reply to this post by Elsass Philippe
Thanks Marc,
checking if some PHP files were loaded sound obvious when you read it ;)

I'll happily switch to neko and try Huge's article (if it's still up to date):
http://gamehaxe.com/2009/12/03/neko-on-shared-hosting/
but this host doesn't offer ssh access.

Also found some neat ftp-sync tools which will make deployment painless.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

Tarwin Stroh-Spijer
Yeah, it's not blazingly fast, but PHP never is! It's fast enough, and most of the heavy things you will want to do are using built in PHP functions anyway. For example, don't try to write your own image generation script that is cross platform etc when you can simply use / wrap GD.

If you want speed, you can always use the ZendOptimizer (or whatever it is called) which pre-compiles to some kind of byte code.

I've found it's "fast enough". It's not going to be as fast as a single page hit with a bunch of scrappy PHP here and there, but no one writes a full-blown website like that anyway. As stated above there's a lot of horribly large and slow frameworks like Drupal that are just insanely slow anyway. If you look at all the crazy stuff Wordpress does under the hood you'd be horrified.

Just throw another 10 servers at it! (or do what Facebook does and compile from PHP -> CPP!)


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Sat, Jul 9, 2011 at 11:21 PM, Elsass Philippe <[hidden email]> wrote:
Thanks Marc,
checking if some PHP files were loaded sound obvious when you read it ;)

I'll happily switch to neko and try Huge's article (if it's still up to date):
http://gamehaxe.com/2009/12/03/neko-on-shared-hosting/
but this host doesn't offer ssh access.

Also found some neat ftp-sync tools which will make deployment painless.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

singmajesty
Hey Tarwin,

I was going to say something about Concrete5, when I thought that I should  
go and see if anyone has benchmarked this stuff. It isn't completely  
scientific, but I found this, which was interesting:

http://www.code-zen.net/2010/benchmarking-concrete5-vs-wordpress/

I personally use Concrete5 when developing PHP sites. It uses Zend and  
jQuery under the hood, and even supports static page caching, so when  
possible, a page on your site can be static HTML instead of processing PHP.

I think someone in this thread said that PHP was either manageable or  
performed well, but never both. In all of these options, it seems like the  
path to optimization is using some framework, script or server mechanism  
to take manageable code and transform it into something which performs  
more quickly.

Philippe, what are you using for FTP sync? That sounds like something I  
might be able to use :)



On Sat, 09 Jul 2011 07:52:09 -0700, Tarwin Stroh-Spijer  
<[hidden email]> wrote:

> Yeah, it's not blazingly fast, but PHP never is! It's fast enough, and  
> most
> of the heavy things you will want to do are using built in PHP functions
> anyway. For example, don't try to write your own image generation script
> that is cross platform etc when you can simply use / wrap GD.
>
> If you want speed, you can always use the ZendOptimizer (or whatever it  
> is
> called) which pre-compiles to some kind of byte code.
>
> I've found it's "fast enough". It's not going to be as fast as a single  
> page
> hit with a bunch of scrappy PHP here and there, but no one writes a
> full-blown website like that anyway. As stated above there's a lot of
> horribly large and slow frameworks like Drupal that are just insanely  
> slow
> anyway. If you look at all the crazy stuff Wordpress does under the hood
> you'd be horrified.
>
> Just throw another 10 servers at it! (or do what Facebook does and  
> compile
> from PHP -> CPP!)
>
>
> Tarwin Stroh-Spijer
> _______________________
>
> Touch My Pixel
> http://www.touchmypixel.com/
> phone: +61 3 8060 5321
> _______________________
>
>
> On Sat, Jul 9, 2011 at 11:21 PM, Elsass Philippe
> <[hidden email]>wrote:
>
>> Thanks Marc,
>> checking if some PHP files were loaded sound obvious when you read it ;)
>>
>> I'll happily switch to neko and try Huge's article (if it's still up to
>> date):
>> http://gamehaxe.com/2009/12/03/neko-on-shared-hosting/
>> but this host doesn't offer ssh access.
>>
>> Also found some neat ftp-sync tools which will make deployment painless.
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: PHP target questions

MarcWeber
In reply to this post by Tarwin Stroh-Spijer
Excerpts from Tarwin Stroh-Spijer's message of Sat Jul 09 16:52:09 +0200 2011:
> Just throw another 10 servers at it! (or do what Facebook does and compile
> from PHP -> CPP!)
PHP has the advantage that you can still debug it (kind of).

HaXe -> PHP -> CPP ? Then you have to retest your application - because
Those facebook devs have only implemented a subset of PHP.
That's also one of the reasons why phalanger (PHP -> .net) stalled:
There would have been too much C code to port.. (and lack of interest.
The devs could not make a living out of it)

The testing effort also applies when you switch from neko to PHP -
because there may be a lot of simple differences (REQUEST, POST, limit
in pictures which can be passed to web app and such annoying things)

Marc Weber

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: PHP target questions

Elsass Philippe
In reply to this post by Elsass Philippe
Joshua,

I have yet to find a good FTP sync tool that doesn't upload everything
because haxe rewrite all files, even those who didn't change...
Solution is going to be slightly more complex - also I don't have ssh
access to the host so no git/svn sync for me.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: PHP target questions

MarcWeber
Excerpts from Elsass Philippe's message of Sat Jul 09 23:09:44 +0200 2011:
https://github.com/MarcWeber/git-ftp

If you use the git-ftp-minimal script it'll even tell you if somebody
else edited a file on the server so you won't overwrite any changes..

drawback: requires that files are tracked by git.

Seriously, get a server with shell access (SSH). It'll save you tons of
time cause you can login and read log files online and such.

Marc Weber

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: PHP target questions

Nicolas Cannasse
In reply to this post by Elsass Philippe
Le 09/07/2011 23:09, Elsass Philippe a écrit :
> Joshua,
>
> I have yet to find a good FTP sync tool that doesn't upload everything
> because haxe rewrite all files, even those who didn't change...
> Solution is going to be slightly more complex - also I don't have ssh
> access to the host so no git/svn sync for me.

Forget FTP : use ssh + rsync

Nicolas


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: PHP target questions

clemos
Hi,

I've been using git to deploy (PHP non haxe) projects, as described here:
http://toroid.org/ams/git-website-howto
For us at work it's been a very efficient solution, because we often
have only access to preview servers, and then have to mail some
"admin" and give him instructions to deploy the app to production
servers, to which we don't have direct access. (Yeah this is very
serious business...ahem)
Before that, the instructions were like "hello, could you please copy
this list of files - list compiled by hand -, and then perform this
operation blabla". And it was a mess, we sometimes forgot some files,
or forgot to delete some files, etc, and never really knew if preview
and production were really in sync.
Now we only have to ask them to pull the preview version, and we can
even ask them to add additionnal hooks to be run between pull (repo
update) and checkout (copy the app to the document root), like
updating the database, or running tests, for example.
The only "problem" is that you generally have to use two repositories,
especially if it's an haXe or AS3 project: one for the source code and
one for the compiled application...
It's changed our lives anyway :)

Cheers,
Clément

On Sun, Jul 10, 2011 at 8:49 AM, Nicolas Cannasse
<[hidden email]> wrote:

> Le 09/07/2011 23:09, Elsass Philippe a écrit :
>>
>> Joshua,
>>
>> I have yet to find a good FTP sync tool that doesn't upload everything
>> because haxe rewrite all files, even those who didn't change...
>> Solution is going to be slightly more complex - also I don't have ssh
>> access to the host so no git/svn sync for me.
>
> Forget FTP : use ssh + rsync
>
> Nicolas
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org