Live data from Hacker News

Experimenting with HHVM at Etsy

codeascraft.com

21–30 of 39 posts

Re: Experimenting with HHVM at Etsy

#21

I guess the question I've been having is that if I want to begin a new project with performance as a main priority, should I use HHVM+PHP or HHVM+Hack over something like Java or Go, or is it more for making existing PHP codebases more performant.

Depends on what you're building, honestly.

I think that it's easy enough to get a site running entirely on PHP--well tested, well supported, architecturally sound, and rewrite services into as you hit performance bottlenecks.

If performance is absolutely critical to your app, then you may consider writing everything in Java/Go/C++, but it's pretty brutal for doing templating and whatnot. Besides, once you generate the page, there's a good chance you're going to cache a good part of it anyhow!

Re: Experimenting with HHVM at Etsy

#22
Calling setlocale because the user you're currently processing has a different locale? What the..?

Notice: what works in UNIX utilities is not what works for web apps serving many users simultaneously. In fact, I'm pretty sure this doesn't work for UNIX utilities either and is just something you should never touch with your libc. It's like calling non-reentrant strtok, some of this stuff just doesn't exactly fit into todays world.

Re: Experimenting with HHVM at Etsy

#23
post #8

The good news about hhvm is that with the newest builds from the past few months you can finally run it longer than a week without memory leaks and crashing under high loads. If you look at the changelog, you can see it really is a beta product that people use in production anyway https://raw.githubusercontent.com/facebook/hhvm/master/NEWS "Ditko" 26-Feb-2015 finally solved me having to restart it every several days…

This is what caused me to abandon HHVM for plain ol' PHP around a year ago. I was running it in Docker containers and the memory leaks would regularly crash my containers if left unattended for more than a couple of days.

It was quite frustrating because I noticed some definite performance gains (e.g., ~2x faster page loads, etc.), but ultimately opted for PHP's stability.

The benefit to running all this in Docker is that I can swap HHVM back in relatively easily (unless it's changed really dramatically over the past 10 months or so). Your comment has me tempted to give it another shot!

Re: Experimenting with HHVM at Etsy

#24
post #20

I guess the question I've been having is that if I want to begin a new project with performance as a main priority, should I use HHVM+PHP or HHVM+Hack over something like Java or Go, or is it more for making existing PHP codebases more performant.

Go or Java is still faster than HHVM/PHP7. I'm writing my new project (Magento Go (wordplay) ;-) ) in GoLang.

I work with Magento a lot lately. Very interested in hearing about this!

Re: Experimenting with HHVM at Etsy

#25

bespoke endpoints sound like a good compromise, but I wonder why they stick with php for the general apis that the bespoke endpoints consume? Wouldn't they get better scalability if they moved that backend logic to something like Play, which would give you NIO on a jvm? EDIT: Removed mention of "shared-nothing", which I misunderstood.

Anything that touches our production databases, mostly sharded mysql, needs to go through our php orm.

We do have other contained infrastructure that is written in some other languages like go and scala.

Re: Experimenting with HHVM at Etsy

#26

I guess the question I've been having is that if I want to begin a new project with performance as a main priority, should I use HHVM+PHP or HHVM+Hack over something like Java or Go, or is it more for making existing PHP codebases more performant.

IMHO: HHVM/Hacklang are cool and i appreciate Facebooks contributions to building a better PHP enviroment... but at the end of the day, it feels like someone trying to put a V12 engine in a golf cart. It's cool if you are already driving a golf cart, otherwise it's weird.

So if you have the chance to start fresh: choose Java or Go. Or anything else... (define "performance"?)

Re: Experimenting with HHVM at Etsy

#27
Be aware that while HHVM is more or less compatible with PHP now, there is no guarantee it will be in the future,and Hack is definitely not backward compatible with PHP. Not even talking about PHP C extensions.

Re: Experimenting with HHVM at Etsy

#28
post #18

Earlier quoted context omitted.

I was also curious about this. If the main traffic interface is bespoke, I'm sure Esty would investigate other solutions. It would make the most sense to also experiment with Bespoke since it's just an interface that talks to other APIs, likely without any business logic and a huge codebase. It orchestrates other APIs into 'views' for the consumer so you have one consolidated endpoint. I'd personally be curious if th…

It does mean that every tool they've written to work with their stack now needs to have a Go equivalent. For some things, that'll be easy. It also means they now need people who know Go, which means any of their engineers can't just work on the code without learning. It also means deployment will be different. While the technology might make more sense, there's often enough reasons to not use it if you've specialized…

[deleted]

Re: Experimenting with HHVM at Etsy

#29

I guess the question I've been having is that if I want to begin a new project with performance as a main priority, should I use HHVM+PHP or HHVM+Hack over something like Java or Go, or is it more for making existing PHP codebases more performant.

I'm a little surprised that HHVM would make or break anyone's decision to use PHP, since I'd think that there are more important language design concerns and features that ought to figure before it came down to that... at least in a PHP-vs-Java sort of fight, anyway. Big questions like your preferred form of typing (strong/weak, dynamic/static/Hindley-Miller inference, etc), threading, ease of writing list comprehensions, whether you need to have functions as first-class objects, et cetera et cetera. Or the ability to hire developers who use that language.
Post reply on HN