6 ms·
> Nonsense! Why would you waste any resources on infrastructure when you could use them for applications. Every cycle that your garbage collector runs is a cycl
by thecombjelly 11y ago
> Nonsense! Why would you waste any resources on infrastructure when you could use them for applications. Every cycle that your garbage collector runs is a cycle that the cpu could have been sleeping and saving battery life. This concept that we don't need to care about resources anymore is absolute poppycock.
It isn't that simple. Depending on your program it can actually be slower to do manual memory management. malloc isn't free. In some cases allocating memory and performing GC is actually faster.
It's not that we don't have to care about resources at all just that we can sacrifice some of the resources to improve the situation for users and programmers. If that isn't your thing then feel free to write everything in assembly.
- unsatchmo 11y agoThis isn't an either or. The reason your phone gets all day battery life is because the kernel was designed to run well on an i386. Let the app frameworks have cushy memory management but implement the OS in C.
- thecombjelly 11y ago> The reason your phone gets all day battery life is because the kernel was designed to run well on an i386 This is false. The reason your phone has the battery life it does is because the OS and libraries and applications have been written to allow the hardware of the phone to drop in to lower power states as much as possible. Unless the language you have written your OS in has some bizarre requirement to wake up all the hardware constantly then the language doesn't matter a ton when it comes to battery life. What matters is writing programs that wakeup the hardware as infrequently as possible.
- agumonkey 11y agoCPU deep sleep states ?
- capitalsigma 11y ago> it can actually be slower to do manual memory management > we can sacrifice some of the resources Which one is it?
- thecombjelly 11y agoMany times it is less resource intensive to do manual memory management, it just depends. The sacrifice in performance comes more from runtime features like type checking.
- majewsky 11y agoThe only case that I know of when manual memory management is slower is short-running programs which exit before the first GC run, therefore removing the need to do any deallocation at all.