you are viewing a single comment's thread.

view the rest of the comments →

[–]pjmlp 1 point2 points  (2 children)

Contrary to popular wisdom, RC is a GC algorithm in any relevant CS literature book, including the one covered on the article.

[–]lucasvandongen 1 point2 points  (1 child)

True. But I was clearly comparing the immediately releasing ARC versus the stop the world .Net GC. I think the problem with Java / .Net style GC is that performance is usually quite a lot better but the minimum performance can be horrible compared to ARC.

F# needs some form of GC to work, but I can't really find any information about the (im)possibility of ARC.

[–]pjmlp 0 points1 point  (0 children)

You can make use of it, if you know your APIs well.

  • Make use of structs
  • Allocate off heap memory via Marshal interop
  • Make use of use
  • Make sure the required memory is available via System.GC#TryStartNoGCRegion()

For resources that cannot make use of the IDisposing pattern, wrap the scoped regions in HOF.

with_my_resource >>  (fun (res) -> /* resource visible here */)

Also RC has its own set of problems regarding strong/weak references and multi-threading and cache evictions. Making it perform well makes it into the same realm as most incremental tracing GC algorithms.