[GH-ISSUE #46] picker makes garbage #327

Open
opened 2026-03-13 14:39:55 +03:00 by kerem · 1 comment
Owner

Originally created by @abh on GitHub (Nov 4, 2013).
Original GitHub issue: https://github.com/abh/geodns/issues/46

From doing some memory profiling it looks like picker.go makes a fair amount of garbage when it copies the list of records so it can manipulate it to not get duplicate results.

(cc @miekg for suggestions).

Originally created by @abh on GitHub (Nov 4, 2013). Original GitHub issue: https://github.com/abh/geodns/issues/46 From doing some memory profiling it looks like [picker.go](https://github.com/abh/geodns/blob/master/picker.go#L39) makes a fair amount of garbage when it copies the list of records so it can manipulate it to not get duplicate results. (cc @miekg for suggestions).
Author
Owner

@miekg commented on GitHub (Nov 4, 2013):

[ Quoting notifications@github.com in "[geodns] picker makes garbage (#46)..." ]

From doing some memory profiling it looks like picker.go makes a fair amount of garbage when it copies the list of records so it can manipulate it to not get duplicate results.

(cc @miekg for suggestions).

I think this inherit to the setup you choose. The copy is done for every
request, so it might make sense to implement a little cache that looks
up these records for each IP and edns0-subnet pair (ugghh).

Another way is to use a pre-alloced piece of memory that you can reuse
instead of claiming something new each time. There was a blog about this
somewhere, some time ago (that use Golang as a language), but can't
remember the name/site.

grtz Miek

<!-- gh-comment-id:27667951 --> @miekg commented on GitHub (Nov 4, 2013): [ Quoting notifications@github.com in "[geodns] picker makes garbage (#46)..." ] > From doing some memory profiling it looks like [picker.go](https://github.com/abh/geodns/blob/master/picker.go#L39) makes a fair amount of garbage when it copies the list of records so it can manipulate it to not get duplicate results. > > (cc @miekg for suggestions). I think this inherit to the setup you choose. The copy is done for every request, so it might make sense to implement a little cache that looks up these records for each IP and edns0-subnet pair (ugghh). Another way is to use a pre-alloced piece of memory that you can reuse instead of claiming something new each time. There was a blog about this somewhere, some time ago (that use Golang as a language), but can't remember the name/site. grtz Miek
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/geodns#327
No description provided.