how to speed up script executing at the first time

Discussion about the open-source Phalanger [?] project.

how to speed up script executing at the first time

Postby adesun » November 2nd, 2012, 3:03 pm

phalanger is great ! I love it .

I found that executing time is a little bit longer at the first time

so, how to improve this case correctly ?

I saw the doc and knew pre-compiling can make it better in some way

but I'm still a little confused about the details.

would you guys give me some instructions on this problem

and is it possible to move or delete php files after precompiled ?

thx!!

Adesun
adesun
 
Posts: 11
Joined: April 23rd, 2012, 3:22 am

Re: how to speed up script executing at the first time

Postby Jakub Misek » November 2nd, 2012, 4:07 pm

Hi, Thanks for your message!

Most of the startup time is .NET jittering (compiling of managed code to machine code), compiling of PHP scripts and loading of referenced assemblies.

You can improve this by compiling your PHP web in advance. (phpc.exe /target:web /root:. /recurse:.) This will result in bin\WebPages.dll assembly which would be used. So WebPages.dll would serve as a precompiled cache.

If you change a script file, it will be automatically re-compiled. (There are then .config options to disable loading of .php files from file system at all, so Phalanger will always use WebPages.dll only)

Then you can NGEN this DLL - this means .NET will compile this assembly and referenced assemblies into machine code, and save into its cache. In this way you would save the jittering time.

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: how to speed up script executing at the first time

Postby adesun » November 3rd, 2012, 9:30 am

thank you very much!

It helps me a lot.

BTW, I downloaded WPDOT and set it up on my pc

generally it ran well , there is only one problem

it displayed garbled when post something like CJK

ggg.gif


I checked it out , the encoding of Mysql database is utf8.

and <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />

how to handle this problem?

thx!

Adesun
You do not have the required permissions to view the files attached to this post.
adesun
 
Posts: 11
Joined: April 23rd, 2012, 3:22 am

Re: how to speed up script executing at the first time

Postby Jakub Misek » November 3rd, 2012, 11:49 am

Also there should be following
Code: Select all
<phpNet>
   <globalization>
      <set name="PageEncoding" value="utf-8" />
   </globalization>
Let me know if this works for you.
Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: how to speed up script executing at the first time

Postby adesun » November 3rd, 2012, 1:44 pm

yes , I used the default web.config

It does have
Code: Select all
<phpNet>
   <globalization>
      <set name="PageEncoding" value="utf-8" />
   </globalization>


It's wired when I changed the website of WpDot from 32bit to 64bit mode

then changed back to 32bit. this problem disappeared but I did nothing else. :shock:

It seems that the memory usage of WpDot website is kinda of high.

the usage of this brand new WpDot website is almost 350MB. :?

Is it normal ?
USAGE.gif


I will do some further test and post the problem if I find some new .


Jakub thank you very much for your help!

Adesun
You do not have the required permissions to view the files attached to this post.
adesun
 
Posts: 11
Joined: April 23rd, 2012, 3:22 am

Re: how to speed up script executing at the first time

Postby Jakub Misek » November 6th, 2012, 3:53 pm

This is very normal for .NET web apps. Note most of memory is just a cache, or just preallocated. We can do some memory profiling optionally, but it seams ok for me.

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: how to speed up script executing at the first time

Postby adesun » November 7th, 2012, 3:09 am

:) I see.

thx!

Adesun
adesun
 
Posts: 11
Joined: April 23rd, 2012, 3:22 am


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 20 guests

cron

User Control Panel

Login

Who is online

In total there are 20 users online :: 0 registered, 0 hidden and 20 guests (based on users active over the past 5 minutes)
Most users ever online was 297 on March 29th, 2024, 7:06 am

Users browsing this forum: No registered users and 20 guests