Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container/heap: add Fix #5372

Closed
bradfitz opened this issue Apr 29, 2013 · 9 comments
Closed

container/heap: add Fix #5372

bradfitz opened this issue Apr 29, 2013 · 9 comments
Milestone

Comments

@bradfitz
Copy link
Contributor

In a merging sstable iterator, I needed to copy container/heap's down function.

It'd be nice if it were exported. Something like:

// Down pushes down the minimum element from the heap into its proper location.
// It should be called if the minimum element's value is modified.
func Down(h Interface)
@rsc
Copy link
Contributor

rsc commented Apr 29, 2013

Comment 1:

Down = Remove + Push.

@rsc
Copy link
Contributor

rsc commented Apr 29, 2013

Comment 2:

(And furthermore Down is an implementation detail. Using Remove+Push is
much better. If we were going to optimize it, it would be to add something
like Fix which means 'position i just changed; move it to the right place'.
That might mean moving it up or down.)

@bradfitz
Copy link
Contributor Author

Comment 3:

Yes, I know how to use heap.
This is an optimization request.  I had to copy the implementation of down() into
sstable to reduce CPU because so much time was spent in up/down/Less.
I'm fine with Fix(Interface, int).

@griesemer
Copy link
Contributor

Comment 4:

Owner changed to @griesemer.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 5:

Labels changed: added go1.2, feature.

@PieterD
Copy link
Contributor

PieterD commented Aug 1, 2013

Comment 6:

I've got a CL for this and issue #5577, but forgot to mail it out. I'll do it when I get
home in a few hours.

@PieterD
Copy link
Contributor

PieterD commented Aug 1, 2013

Comment 7:

https://golang.org/cl/12265043/

@davecheney
Copy link
Contributor

Comment 8:

Status changed to Started.

@griesemer
Copy link
Contributor

Comment 9:

This issue was closed by revision dd6f49d.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants