On Thu, May 26, 2016 at 11:44 AM, Chris Rackauckas <rackd...@gmail.com> wrote:
> Thanks, that's good to know. Can you explain a little bit about why it would
> hurt performance?

See my response on an old thread.
https://groups.google.com/forum/?fromgroups=#!searchin/julia-users/Suspending$20Garbage$20Collection$20for$20Performance...good$20idea$20or$20bad$20idea$3F/julia-users/6_XvoLBzN60/nkB30SwmdHQJ

In short, the key points are that

1. Freeing memory is not free.

    You need to do work so that you can reclaim it later, (why would
you free it otherwise....)

2. Doing the work incrementally is typically more expensive than doing
the work in batches.

    This is where the trade off between latency and throughput comes in.

These being said, there are of course cases that you can construct
with manually tweaked memory management that beats the best GC which
has to guess the best strategy (and finding such example should be
easier for a less optimized GC). However, I think currently the
unsafeness, the likelihood of misuse and the impact on other part of
the runtime doesn't really justify introducing manual memory
management of julia objects.

>
> On Thursday, May 26, 2016 at 8:23:34 AM UTC-7, Yichao Yu wrote:
>>
>> On Thu, May 26, 2016 at 11:06 AM, Chris Rackauckas <rack...@gmail.com>
>> wrote:
>> > I see mentions like this one every once in awhile:
>> >
>> > "D language is a special case, as it has GC, but it's also optional (as
>> > with
>> > Julia)"
>> >
>> > Is GC optional?
>>
>> No, Not for julia objects.
>>
>> > I thought the only way to discard something from memory was
>> > to set it to zero and call garbage control (which then runs the whole
>> > garbage control). Is there a more targeted way to delete things?
>>
>> No, Not for julia objects.
>>
>> > If it's not
>> > already available, it seems like it would be useful for code focusing
>> > performance as an option.
>>
>> This will actually **not** improve performance most of the time and
>> can actually hurt performance a lot.
>> The only case I can think of that can have better performance is
>> manually managing an object pool.
>> This might improve latency or memory usage. All of the advantage can
>> be obtained by improving the GC itself, which is the preferred way.
>> This feature will also be extremely unsafe and can break many
>> assumptions made in the runtime.

Reply via email to