Hi Philip,
For this abstract overview, performance is measured in terms of particular applications. I base this on a general observation that for any frequently used metric of performance in an application, specialized garbage collectors have been created which outperform manual allocation/releasing in the same application. Runtime environments which are known to run many different kinds of programs typically use collectors that balance the needs of a wide variety of expected use cases, and within the past few years have done an exceptional job in practice.
âInefficient memory practicesâ can manifest in many ways, both direct and indirect. One example of a direct inefficiency involves implementing GC-like features such as reference-counting pointers in C++ to addresses certain memory management concerns, often with great success in very large codebases. The downsides of this include both the use of additional memory for the reference count and the performance impact of manipulating reference counts. While âbest practicesâ<http://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/> for these pointers (e.g. passing by const reference to avoid incrementing/decrementing the count) serve to reduce the performance impact, you will never reach the performance offered by GC-backed reference counting solutions such as Ulterior Reference Counting<http://grothoff.org/christian/teaching/2007/4705/urc-oopsla-2003.pdf>. An indirect efficiency might be that time spent resolving memory allocation issues may leave developers with less available time during the development cycle to address higher-level concerns such as algorithms and communication layers within the software. Performance frequently suffers in these areas regardless of the memory management system in use, so keeping developer resources available to focus on them can be very valuable.
Thanks,
Sam
From: Philip O'Toole [mailto:philip.otoole-/***@public.gmane.org]
Sent: Wednesday, July 23, 2014 11:45 PM
To: Sam Harwell; Archos; golang-nuts-/***@public.gmane.org
Subject: Re: [go-nuts] Go 2.0 without garbage collector?
Sam -- interesting statements. In your opening paragraph, what do you mean by "performance"? You're talking about sheer througput of, say, a program moving data through RAM?
And can you give an example of what you mean by "inefficient memory practices"? I've seen plenty of inefficent memory practices in garbage-collected languagues (notably Java, running in a modern HotSpot JVM) that negate the theoretical advantage offered by automatic management. :-)
(FWIW, I don't have a strong opinion about GC, or lack thereof. I am using Go because it, so far, makes writing system software pretty nice).
Philip
-----------------------------------------
http://www.philipotoole.com
On Wednesday, July 23, 2014 9:12 PM, Sam Harwell <sam-8CAjhppLBTbEP2vymgFrBlaTQe2KTcn/@public.gmane.org<mailto:sam-8CAjhppLBTbEP2vymgFrBlaTQe2KTcn/@public.gmane.org>> wrote:
The best possible performance actually comes from using a Garbage Collector for memory management in all but one case. That specific case is writing an application which needs to run in as little memory as possible, regardless of the performance impact of that decision. As we all know, that situation virtually never arises in modern programming. Also note that this situation generally does not apply to large programs, because the coding complexity of manual memory management throughout a large codebase results in inefficient memory practices that negate the theoretical advantage offered by manual management.
However, the following caveats do hold:
1. For a particular application (algorithm and/or memory usage characteristics), some garbage collector will outperform the available manually-managed allocators for that application. However, there is no garbage collector which performs best for all applications. The best production garbage collectors generally fall into three categories according to the anticipated majority of applications which will run within the environment:
a. High-throughput collectors which target applications with exceptionally large memory spaces, and often allocate objects at higher rates than seen in other applications. These could be called âserverâ collectors (not to be confused with the -server command line option in the JVM).
b. Concurrent, low-latency collectors which balance throughput with pauses and are widely applicable to âclientâ applications. By overall usage, these are currently the most commonly used garbage collectors, and are the foundations of both the current .NET Framework collector and the JVM.
c. Real-time garbage collectors which provide hard guarantees regarding the duration of a pause. These collectors are used in specialized applications where a long GC pause poses a physical threat (e.g. system control software for aviation). IBMâs Metronome is a prime example of this type of collector.
2. The amount of work required to implement an efficient garbage collection environment within a new language is not only enormous, but often requires the involvement of researchers who focus on this particular area of software development (and arenât particularly common). The âeasyâ to implement collectors are frequently much slower than the better algorithms, resulting in the unfortunately common situation where garbage collectors get a bad name. In particular, when a garbage collector is first introduced to a new environment, users observe poor performance compared to the manually-managed environment in which they previously worked, but they do not realize that this deficit is due to the particular garbage collector which was added and not an overall characteristic of all garbage collectors.
a. One of the best ways for young garbage-collected languages to be fairly evaluated for new language features is to write a compiler that targets the bytecode of an existing runtime system that includes a high-performance garbage collector. The most well supported options are the CLI (.NET) and the JVM (Java). For better or worse, larger projects with better funding (such as Go) tend to have an easier time avoiding this path.
Thanks,
Sam
From: golang-nuts-/***@public.gmane.org<mailto:golang-nuts-/***@public.gmane.org> [mailto:golang-nuts-/***@public.gmane.org] On Behalf Of Archos
Sent: Thursday, July 17, 2014 3:52 AM
To: golang-nuts-/***@public.gmane.org<mailto:golang-nuts-/***@public.gmane.org>
Subject: [go-nuts] Go 2.0 without garbage collector?
Does the Go team has thinked into a next version without the garbage collector?
Go is very cool to use but I need the best possible performance since I've not deep pockets like Google. When you are small, you need try to minimize the cost of the servers.
And Rust does a great balance between a language of high level without a significant loss of performance.
I've been translating some Go projects from Go to Rust but the task is very large, especially since every time there are more interesting projects for me.
So, the fastest way for me will be to build a transpiler from Go to Rust. At least there is some intention to have an optional garbage collection.
However, Go is easier to prototype.
--
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+unsubscribe-/***@public.gmane.org<mailto:golang-nuts+unsubscribe-/***@public.gmane.org>.
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+unsubscribe-/***@public.gmane.org<mailto:golang-nuts+unsubscribe-/***@public.gmane.org>.
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.