Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Advertise on LowEndTalk.com
Performance optimization - How to compile PHP with "PGO" ?
New on LowEndTalk? Please Register and read our Community Rules.

Performance optimization - How to compile PHP with "PGO" ?

Did anyone tried to compile PHP with Profile Guided Optimization (PGO) with DirectAdmin?
Would like to hear if anyone had succes? How to do it?

I tried centminmod where you can activate PGO, and damn there are atleast 20-25% performance boost in my tests!

All clients can't go with centminmod due to the lack of GUI. Would like to hear if same option is possible with DirectAdmin? How to?

Comments

  • Oh how cute. the word Performance next to PHP.

    How adorable.

  • CConnerCConner Member, Provider
    edited February 19

    @Jona4s said:
    Oh how cute. the word Performance next to PHP.

    How adorable.

    Want a cookie for being all cool on the "we hate PHP but can't come up with a good reason" bandwagon?

    GameDash, an AIO solution uniting billing, support & game server management platform.
    Visit our website or join our Discord to find out more.

  • @CConner said: "we hate PHP but can't come up with a good reason"

    They don't have time for that. They busy writing websites in ASM or C.

    Thanked by 2raindog308 hackerman

    #!/Bashblog.net | Free Wordpress Hosting | If you can't idle, what's the point?

  • @CConner said:

    @Jona4s said:
    Oh how cute. the word Performance next to PHP.

    How adorable.

    Want a cookie for being all cool on the "we hate PHP but can't come up with a good reason" bandwagon?

    No point in explaining morons why the zend project concurrency model of spawning a thread per request makes it the worst performing language for the past ~6 years worth of benchamarks @ TechEmpower.

    But I do like how girls like you feel the need to post long messages and press a lot of keystrokes.

  • evnixevnix Member
    edited February 19

    model of spawning a thread per request makes it the worst performing language for the past ~6 years worth of benchamarks @ TechEmpower.

    worst compared to what other scripting language? NodeJS? Ruby? Python?
    PHP in itself is actually faster than all the three and with an actual Type system.
    People use the thread per request model for convenience and not speed.

    if you need performance, PHP does async too, https://www.swoole.co.uk/ https://amphp.org/ https://reactphp.org/

    some benchmarks for what async PHP can do,
    https://medium.com/@rioastamal/benchmark-php-swoole-vs-nodejs-vs-go-539a5493b067

    [Member since 2012

  • CrossBoxCrossBox Member, Provider
    edited February 19

    Golang is the king. We had many issues with Python not having type safety and being slow/memory hungry in some tasks. Rewriting almost the entire backend to Go was painful but totally worth it in the end.

    Thanked by 1Jona4s

    CrossBox.io
    Bringing a better Email, Chat & Files to cPanel, Plesk, DirectAdmin and the World.

  • nemnem Member, Provider

    @Jona4s said:
    No point in explaining morons why the zend project concurrency model of spawning a thread per request makes it the worst performing language for the past ~6 years worth of benchamarks @ TechEmpower.

    Postgres would like a word with you. It's a single process per connection and requires some intermediary connection pooling to work in a high performance environment. Wonder why it's never under the same crosshairs as PHP...

    Thanked by 1hackerman
  • @Jona4s said:

    @CConner said:

    @Jona4s said:
    Oh how cute. the word Performance next to PHP.

    How adorable.

    Want a cookie for being all cool on the "we hate PHP but can't come up with a good reason" bandwagon?

    No point in explaining morons why the zend project concurrency model of spawning a thread per request makes it the worst performing language for the past ~6 years worth of benchamarks @ TechEmpower.

    But I do like how girls like you feel the need to post long messages and press a lot of keystrokes.

    Nodejs would like a word with you.

    Thanked by 1hackerman

    hm. I've lost a machine.. literally lost. it responds to ping, it works completely, I just can't figure out where in my apartment it is.

  • @nem said:

    Postgres would like a word with you. It's a single process per connection and requires some intermediary connection pooling to work in a high performance environment. Wonder why it's never under the same crosshairs as PHP...

    @serv_ee said:
    Nodejs would like a word with you.

    Unlike PHP or Node, Golang was created with 3 core performance concepts.

    A userspace scheduler, Proc.go, which puts each connection (goroutines) that calls accept4() and epollwait() into G queues inside a single M thread, that needs a P (idle cpu) for the scheduler to unpark and run.

    Nodejs tries to do the same with the Event Queue, however, it's just a callback, not a preemptive scheduler like Go.

    Second thing Go has is a netpoller, which waits in a loop for epoll events.
    n := epollwait(epfd, &events[0], int32(len(events)), waitms
    return gList{}

    @ TEXT runtime.epollwait(SB) /usr/local/go/src/runtime/sys_linux_amd64.s

    If an event returns, the netpoller will check for parked G queues, and mark them as runnable.

    Go also has an arena heap memory model, which allows goroutines to exchange data using only 2 instructions.

    If you compare the scalability of Go with PHP, you will notice PHP guys don't really bother in firing hundreds of expensive syscalls, have no control over blocking syscalls, have interpreted code that burns runtime cycles just for parsing syntax into IR, they lack pointers, thread synchronization and memory safety primitives, and a horrible model of cloning threads per connection.

    Take guys like Ryan Dahl, creator of Node.js, publicly saying Node is a piece of crap compared with Go.

    Just look at his quotes about Node/PHP.

    Thanked by 1CrossBox
  • Those golang fanboys... 2+2 - use golang. Need a website? Use golang. Need an AI? Sure, slam golang on it.

    Every language has it's place. This topic about PHP and PGO. So back on topic - PGO is not worth the time in compare to performance increase. It is very negligible. Just APC and you are done.

    #!/Bashblog.net | Free Wordpress Hosting | If you can't idle, what's the point?

  • nemnem Member, Provider
    edited February 19

    @Jona4s said: have no control over blocking syscalls

    Eh you can use generators and asynchronous signal handling these days in PHP. It's not as fast as some alternatives, but does the job when programmed accordingly.

    OP was asking about PHP, not regurgitating a Go whitepaper.

    @LTniger said: Just APC and you are done.

    APC was superseded by OPCache unless you want an embeddable userland cache, then apcu.

    Thanked by 1CrossBox
  • @nem said: I have 20 IQ.

    That is actually hilarious.

    • memory safety primitives, ffi is the closest to low-level mucking but there's other data types that are high performance in PHP land

    External calls to C code because you can't do it in PHP.

    Bytecode cache because you can't compile into native code.

    OS threads with mutex syscalls, because yeah why not, you have no idea what user-threads are in terms of performance. No context switching, no expensive IPC, only atomic CAS, why bother.

    There is a good reason why Techempower calls programmers from all over the world to submit their best code in their language, and not a single guy in 10 years has ever made it into top ~80 with PHP, where Go ranks top 10 consistently.

    Look at the garbage of Swoole. Rank #143. That is the best PHP can offer.

    PHP is a joke among software engineers, everybody @ TE laughs at how crappy it performs.

  • nemnem Member, Provider

    @Jona4s said: I have 20 IQ.

    Y'know, that's the nicest thing anyone's said about me in a long time. I'm going to take it.

    Thanked by 1hackerman
  • CConnerCConner Member, Provider

    Heading over to https://www.lowendtalk.com/profile/comments/Jona4s and searching for the word "PHP" is actually hilarious.

    GameDash, an AIO solution uniting billing, support & game server management platform.
    Visit our website or join our Discord to find out more.

  • nemnem Member, Provider
    edited February 20

    @CConner said:
    Heading over to https://www.lowendtalk.com/profile/comments/Jona4s and searching for the word "PHP" is actually hilarious.

    I bowed out when his link back wasn't its composite score - in which PHP does decent - but the worst of the worst, a plaintext cloud benchmark.

    This comment especially had me. Poor nikic and his shit CS/Phys degree from Technical University of Berlin. Reminds me of that equally shitty programmer... what's his name, Venma Wieste... no no... must be Wietse Venema. Guy's such an oddball it's hard to place it together, but I believe from a cursory Google and IBM's corporate pages... he's... right, the architect of Postfix. Much of this invective is simply backdated.

    PHP was terrible in 4 and 5, that I'll agree (as were most languages of the era). 7 and 8 are moving the language forward. Don't conflate the core talent behind PHP now with what it had in 1999. They're moving things along at a frenetic pace. Go's great benefit (Rust too) is that it started later and could learn from the mistakes of its progenitors. At some point when things slow down I want to rewrite my PAM handlers in Rust because C gives me the heebie jeebies.

    Edit: restating the pace of current development sponsored by JetBrains.

    Thanked by 1hackerman
  • @nem said:
    I bowed out when his link back wasn't its composite score - in which PHP does decent - but the worst of the worst, a plaintext cloud benchmark.

    It's nice to see a mongoloid provider who can't tell the difference between application code used for the overall score, and the language runtime that stresses plaintext requests.

    Must be why you enjoy using a scripting language.

  • CConnerCConner Member, Provider

    @Jona4s said:

    @nem said:
    I bowed out when his link back wasn't its composite score - in which PHP does decent - but the worst of the worst, a plaintext cloud benchmark.

    It's nice to see a mongoloid provider who can't tell the difference between application code used for the overall score, and the language runtime that stresses plaintext requests.

    Must be why you enjoy using a scripting language.

    Is that the only reply you could think of? What a way to admit that you are wrong.

    GameDash, an AIO solution uniting billing, support & game server management platform.
    Visit our website or join our Discord to find out more.

  • Jona4sJona4s Member
    edited February 20

    Of course I'm wrong. I'm replying to a bunch of morons.

    Doesn't get worse than that.

  • Ahhh, personally attacking users here like calling them morons should prove your point. Maybe try more civilized responses and maybe someone here would actually consider your opinions.

    Thanked by 2darb hackerman
  • darbdarb Member

    all part of the low end experience; attack, belittle and insult - low end mentality.

    @edoarudo5 said:
    Ahhh, personally attacking users here like calling them morons should prove your point. Maybe try more civilized responses and maybe someone here would actually consider your opinions.

  • @Jona4s said:
    Of course I'm wrong. I'm replying to a bunch of morons.

    Doesn't get worse than that.

    If there's one thing you should take from this thread: you're pretty shit, stay away from any parties until you get over whatever troubling shit you're going through.

    Thanked by 1nem
  • @edoarudo5 said:
    Ahhh, personally attacking users here like calling them morons should prove your point. Maybe try more civilized responses and maybe someone here would actually consider your opinions.

    Doesn't matter if they are morons or not.

    PHP is a piece of garbage as proven by Techempower.

    What's the discussion here?

  • @Jona4s said: It's nice to see a mongoloid provider who can't tell the difference

    Now replace the word "mongoloid" with "black" and see how racist that sounds. There was no need for that word.

    @Jona4s said: PHP is a piece of garbage as proven by Techempower.

    compared to a compiled language? May be. but PHP is inherently better when it comes to economics, Faster dev cycles, no process restarts required and better state isolation.

    Given a choice between PHP and Go for web development, I would choose PHP any day because there is a lot more to a business than than saving a few milliseconds. It took me a while to understand this, but in the world out there, Adding new machines is cheap but developers are very expensive.

    [Member since 2012

Sign In or Register to comment.