peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.31k stars 201 forks source link

program execution time #1113

Closed N0zzy closed 1 year ago

N0zzy commented 1 year ago

skFLJKoNo6k

this small code in original php runs in less than 1 second, and in pie from 5 to 10 seconds. how to fix it and is it possible? is it possible?

jakubmisek commented 1 year ago

Because it's in a global code which is unoptimized.

Try puting it into a function, and compile in release mode.

N0zzy commented 1 year ago

thanks for trying to help. I was able to solve this problem using the C Sharp thread library.

jakubmisek commented 1 year ago

C# would be the same speed in this case:

function test() {
  for ($i = 0; $i < 10000; $i++) {}
}