4 ms·
If engineering time wasn't an issue, how much would a company of Instagram's scale save by switching from Python to a lower level language like C++? Pretend you
by sorenjan 10y ago
If engineering time wasn't an issue, how much would a company of Instagram's scale save by switching from Python to a lower level language like C++? Pretend you could wave a magic wand and overnight have the entire code base transformed from Python to well written C++, how would that affect the hardware requirements, and future development?
I guess what I'm really asking is what pros and cons are there with using dynamic and relatively slow languages compared to faster languages like C++, Java, or C#? My uninformed reaction is that it's easy for startups to get started with these easy languages but that it leads to problems when it's time to scale up. Dropbox is writing their own Python implementation, and Facebook have their PHP to C++ compiler.
- nemothekid 10y ago>how much would a company of Instagram's scale switching from Python to a lower level language like C++ I guess one thing you have to consider is 1. How many engineers do you have to hire to make Python "fast enough" vs 2. What does it cost to deploy a full C++ team? Is it easier for new programmers to learn & write safe C++ code vs. Python. I wonder what is cheaper?
- SEJeff 10y agos/C\+\+/golang/g
- kirkdouglas 10y agoFrom the users perspective they're doing fine (haven't had any problems with Instagram performance).
- draw_down 10y agoMajor con: Good luck finding people who want to write a web app in C++.
- weberc2 10y agoThis is probably an extension of the "if developer time wasn't an issue"; at least that's a major factor for me (not being able to develop quickly).
- Scramblejams 10y agoIt's important to remember that for a lot of network server purposes, your code only has to be fast enough to saturate your network interface, and after that there isn't much point in trying to speed things up. Not sure how often that's the case in Instagram's use, but I've been using Python and Twisted to saturate network interfaces effectively since 2003 :-), and in those situations I've been more interested in the correctness advantages of a good statically-typed language rather than the performance.
- abiox 10y agotime-to-saturation is also worth considering.
- nine_k 10y agoС++ is not exactly a comfortable language. While recent changes may be great, and there are quite nice libraries, the language still does little to prevent you from shooting yourself in the foot (and sometimes downright provokes it). If I were about high speed, I'd take Java (which regularly rivals, and sometimes surpasses, C++ in speed), or Rust, or maybe Go. Other worthy contenders would be Haskell, OCaml, D, maybe even Elixir (unless they are CPU-heavy), though with these hiring becomes much harder than with Python or Java (and probably even C++).
- pbreit 10y agoDeveloper productivity is crucial to figuring out a business and then in the rare event that you actual get product/market fit, scaling is trivial (ie, no one ever failed to scale, not even Friendster).
- sametmax 10y agoEven when engineering time is not an issue, Python stays. Look at dropbox: they convert a part of they code to rust for performance reasons. Yet they have no plan to replace the whole Python code base, because Python is very convenient to use for no performance critical part of the app that are affected by it's dynamic nature. And they are not that numerous. In the end, it's not just time, it's also a matter of confort and even pleasure.