5 ms·
Oki, got it. Can't decide if that sounds like horrible conditions or a fun challenge =) For reference, the Go 1.5 GC propaganda: > Go 1.5, the first glimpse o
by gizzlon 10y ago
Oki, got it. Can't decide if that sounds like horrible conditions or a fun challenge =)
For reference, the Go 1.5 GC propaganda:
> Go 1.5, the first glimpse of this future, achieves GC latencies well below the 10 millisecond goal we set a year ago.
Blog post:
https://blog.golang.org/go15gc https://blog.golang.org/go15gc
Slide:
https://talks.golang.org/2015/go-gc.pdf https://talks.golang.org/2015/go-gc.pdf
Talk:
https://www.youtube.com/watch?v=aiv1JOfMjm0 https://www.youtube.com/watch?v=aiv1JOfMjm0
Edit:
Meanwhile, over in Java land they measure stop the world pauses in seconds, not milliseconds:
http://stackoverflow.com/questions/15696585/long-gc-pauses-in-application http://stackoverflow.com/questions/15696585/long-gc-pauses-i...
https://blogs.oracle.com/poonam/entry/troubleshooting_long_gc_pauses https://blogs.oracle.com/poonam/entry/troubleshooting_long_g...
- vvanders 10y ago10ms is also 2/3rds of a frame @ 60FPS which is going to guarantee dropped frames if you're doing anything soft real-time. Also most GC'd languages don't give you strong control over data locality(by nature of everything being a reference) so you pay in cache misses which are not cheap.
- shinymark 10y agoFor another comparison 10 ms is nearly your entire frame at 90hz for current VR headsets.
- jerf 10y agoGo gives you decent control over layout, much better than most scripting languages. It's not quite as good as C, mostly due to not having a wide variety of very complicated data structures to choose from; you've got structs, arrays, and maps. But the first two in particular let you do many things to control locality. It's also worth pointing out 10ms is the maximum, not the minimum. There's plenty of workloads where you're not going to see pauses anywhere near that long. It's certainly not impossible to write a 3D game in Go and get 60 fps with high reliability, especially with the amount of stuff nowadays that actually runs on the GPU. You're not going to be able to do this for your next AAA game, but I wouldn't see a huge reason that an "indie" game couldn't use Go for that. (Probably not my first choice, all else being equal with library support personally I'd suggest Rust for this for a lot of other reasons (the type of concurrency you often get in games is going to be well supported with Rust's borrow checker architecture), but contrary to some discussion I would say it is still on the table.)
- jleahy 10y agoIt's not worth it, because as soon as you go down this route you're going to be constantly thinking about the GC. If I add a cyclic reference here will that make GCs longer? Maybe I should have a free list and reuse these objects (after all they're responsible for most of my allocations)? As soon as you're thinking like that as you write each line of code you've lost all of the benefits of the language being high-level, and you'd be better of controlling memory manually.
- AnimalMuppet 10y ago> It's certainly not impossible to write a 3D game in Go and get 60 fps with high reliability... But it's hard to write a 3D game in Go and get 60 fps with certainty.
- jerf 10y agoBut so what? It's impossible to write a 3D game in anything and get 60 fps with certainty. If the McAfee Disk Bandwidth Consumer decides to kick in, you may take a penalty on disk access. If the system specs are slightly lower than you planned for, you don't get your guaranteed 60 fps. If the GPU overheats and underclocks, you don't get 60fps. It's not that hard to write something in Go where you pay two milliseconds every 5 minutes or something, or less than that. Again, let me reiterate, 10ms per sweep is the max, not the min. Plus it sounds like people think that Go somehow guarantees that you're going to pay this on every frame or something, rather than potentially separated by seconds or minutes. As I said, Go probably isn't my first choice for a game anyhow, but people are grossly overstating how bad it is. Games may be high performance, but they also do things like run huge swathes of the game on a relatively slow scripting language like Lua or some Lisp variant or something. It's not like the network servers that are Go's core design motivation are completely insensitive to performance or latency either. (Plus to be honest I reject the premise that all games must be 60 fps on the grounds that they already aren't. I already disclaimed AAA vs. Indie. But it's still not a bad discussion.)
- zzzcpan 10y agoGC pauses are not the real reason people hate GCs even when they say otherwise. It's mostly about the cognitive overhead GC imposes on you and compromises that it forces you to take. If it's there - you are always aware of it, you cannot ignore it, you know it's unpredictable, but you know there are better predictable choices and it makes it very hard to feel good about the quality of the software you write. It's like it forces you to accept mediocrity.
- nindalf 10y agoI encourage you to read the links on the comment you responded to. If you had, you would have found that as of Go 1.5 the pauses are 2ms or less for a heapsize < 1GB. In Go 1.6 this reduced further. The 10ms pause that you're thinking of it the upper limit, not what actually happens even at heapsizes of 100GB+
- vvanders 10y ago2ms is still more than the entire budget we'd dedicate to animation on a lot of scenes. You want predictable performance in these cases and tracing GCs are fundamentally opposed to this. Generally you're much better off using a scripting language like Lua for the places where you want the advantages GC brings but scoping it so you can limit the damage it does to your frame time.
- nickpsecurity 10y agoWhat about microseconds using the category of collectors designed for your application area (real-time or minimal delay)? http://www.cs.technion.ac.il/~erez/Papers/real-time-pldi.pdf http://www.cs.technion.ac.il/~erez/Papers/real-time-pldi.pdf
- vvanders 10y agoCAS on every property write? That adds up really quickly which is why Rust has Rc vs Arc. The issue with GC is it's not deterministic. There's a whole nother aspect that has to do with free heap space. Quite a few GCs need some multiple of working set free to do the compact phase. If they don't have it then GC times start to spiral out of control. On an embedded device(or modern game console) you'll be lucky to have 5-10mb free. On PSP we used to have only 8mb total since 24/32mb went to video+audio. We still ran Lua because we could constrain it to a 400kb block and we knew it would never outgrow it. Just like everything in software there's different tools for different domain spaces. Otherwise someone would just write one piece of software that fits every problem and we'd all be out of a job.
- 10y ago
- cmrdporcupine 10y ago10ms latency is crap if you're doing something like realtime ad exchange bidding, where you have <60ms bid times. Really do not want that hiccup.