how to speed up script executing at the first time
7 posts
• Page 1 of 1
how to speed up script executing at the first time
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
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
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,
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. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: how to speed up script executing at the first time
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
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
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
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
Also there should be following
Thanks,
- Code: Select all
<phpNet>
<globalization>
<set name="PageEncoding" value="utf-8" />
</globalization>
Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: how to speed up script executing at the first time
yes , I used the default web.config
It does have
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.
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 ?
I will do some further test and post the problem if I find some new .
Jakub thank you very much for your help!
Adesun
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.
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 ?
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
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,
Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: how to speed up script executing at the first time
I see.
thx!
Adesun
thx!
Adesun
- adesun
- Posts: 11
- Joined: April 23rd, 2012, 3:22 am
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests