FAQ
I think he might have meant using a Pool of objects as in sync/Pool for
caching

Ah, well I did try that out but it didn't help my particular situation.

Not to hijack the thread but to reiterate benchmarks (and the intel link
from Dmitry is a great resource), for my case i found two different
approaches for growing storage of my quad tree and my edges worked best.

As new nodes for my tree are created, simply appending those to a slice
instead of trying to allocate space up front worked best for the general
case.

As new edges are created, I guess due to the sheer number, I found that
using an approach similar to bytes.Buffer for pre-allocating space plus
growing the capacity by *= 2 provided significant speed improvements.

Now, my code for edges as-is actually requires this due to how it's used,
but before it did I found this rather curious and the benchmarks and
profiles helped keep me from unnecessarily complicating code.
On Mon, Oct 27, 2014 at 1:53 AM, Tahir wrote:

I think he might have meant using a Pool of objects as in sync/Pool for
caching.

Might be my fault because I asked about the processor cache line size.
This is a tiny bit orthogonal to the topic of GC but since he mentioned
having a big array of objects it made me think that avoiding false sharing
could be something to be kept in mind too.
Still that's an issue that is only relevant if multiple processors are in
play and I suspect that having exactly 8 pointers in T is an informed
choice.

(I still think that with the datastructure you presented, you could forego
the use of pointers completely. Btw I've been bugging, T would be an array
of uint64 not int32)

Note that with `potentially` so many cross referencing objects, not sure
any of them ever becomes garbage.

--
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@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 13 of 13 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 26, '14 at 8:48p
activeOct 27, '14 at 1:27p
posts13
users6
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase