It is even more involved than that. A GC language in a highly concurrent dynamic memory environment can be faster than a hand rolled C or assembly implementation. The important consideration is memory allocation and deallocation costs in the critical path. In a GC environment they are essentially free. In most malloc based ones they are not. It can make a huge difference. Think deallocation of a large tree structure...
> On Feb 4, 2019, at 1:05 AM, Kurtis Rader <kra...@skepticism.us> wrote: > >> On Sun, Feb 3, 2019 at 10:47 PM Amnon Baron Cohen <amno...@gmail.com> wrote: > >> If you really care about each nanosecond of execution time, and are prepared >> to do a lot of work >> to minimise run-time, then C, C++ or Rust may be your best choice. But for >> most of us here, Go does hit the sweetspot. > > Bingo! For that matter if shaving nanoseconds matters you should be using > assembly language. You won't write a lot of useful code but what you do write > might execute fast. Emphasis on "might" since, in my experience, many people > who care about micro benchmarks over all other considerations seldom > understand related considerations such as CPU branch prediction costs and CPU > TLB and cache invalidation. Not to mention considerations that are almost > always more important such as the time required to write the code, it's > correctness, and maintainability. Which are almost always orders of magnitude > more important than whether you have managed to shave every microsecond from > its run time. > > -- > Kurtis Rader > Caretaker of the exceptional canines Junior and Hank > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.