3 ms·
I remember reading a thread once about Kenton trying to optimize some protobuf deserialization routines. After much profiling, the outcome was basically "I can
by nostrademons 12y ago
I remember reading a thread once about Kenton trying to optimize some protobuf deserialization routines. After much profiling, the outcome was basically "I can't believe the compiler is doing this. It means it is basically impossible to predict the performance characteristics of source code." At this point, a number of old compiler guys jumped in (we have a number of folks on the C++ standards committee at Google, and most of the team who wrote HotSpot), and said "Yeah. The best way to make sure your program runs fast is to get it into a compiler team's benchmark."
Chrome/V8 has this problem as well - if you talk to really skilled web developers, they have a lot of performance "tricks" in their head, and the pitfall is that this knowledge decays much more rapidly than people think it decays, and so what was common knowledge in 2008 (or even 2013) is now no longer true. One major problem we faced with Google Search and specifically Instant was that it was optimized for the performance characteristics of the browsers of 2008; pretty much none of those rules apply to modern Chrome and Safari on mobile networks, and so performance is ridiculously bad on mobile.
Go achieves predictable performance only because it's relatively new. It's true that the team has tried very hard to keep things simple and predictable, but the problem is that the hardware that Go runs on keeps changing as well. As a language it was designed to take advantage of multicore chips that are just coming into use now. What if in 5 years we're all using quantum computers, or memristors, or flash memory, or the memory hierarchy no longer applies? What if everything is peer-to-peer over mobile devices?
- pcwalton 12y ago> It's true that the team has tried very hard to keep things simple and predictable, but the problem is that the hardware that Go runs on keeps changing as well. As a language it was designed to take advantage of multicore chips that are just coming into use now. This has already happened; what many people don't realize is that we're arguably past the multicore era. Desktop-class CPUs aren't adding more cores as quickly as we had predicted, because people aren't using them (although note that this is different in mobile). What they are adding is wider and wider SIMD units, and more and more SIMD instructions. To get maximum performance on the CPUs of today, as well as those in the future, using SIMD effectively is every bit as important, or more, as using multiple cores effectively. In my opinion, programming languages have been fairly slow at responding to this.
- seanmcdirmid 12y agoHave CPU SIMD units been very successful? Many cases where you can use SIMD, you can also just go and use the GPU (the ultimate SIMD) instead and get a much better speed up. Larabee (or whatever its called now) hasn't seen very much use either.
- pcwalton 12y agoVery much so. SIMD is part of the cost of admission for video codecs, for example.
- seanmcdirmid 12y agoWhy aren't the video codecs GPU accelerated by default these days? Is there something about decoding video that prevents it from mapping well to the GPU?
- wtallis 12y agoIntel is only on their second generation of OpenCL-capable GPUs, so there are still tons of machines out there that have no GPGPU capability and don't have even a CPU-based OpenCL implementation installed (except on OS X). APIs giving access to fixed-function transcoding engines on GPUs are also not as standard and universal as they should be, and those fixed function engines also have poorer output quality than the good software implementations.
- jerven 12y agoVideo decoding is very branchy and not easily decomposable. e.g. each frame depends on decoding the previous frame. They are however relatively easy to implement in custom hardware (part of the design goals of the standard committee) so in most cases the GPU accelerated decompression does not actually use the standard shaders/pipeline etc... but a separate section of silicon.
- leccine 12y agoWell Erlang is probably the only language that kept multi-core systems in mind and the implementation is pretty nice. It is kind of funny how we crash the entire application process when a thread crashes in it. Also worth to mention the GPGPUs with 1000+ cores on them. We should support those cards and systems better in the mother languages.