Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(433)

Issue 3373041: code review 3373041: Sort: reduced stack depth to lg(n) in quickSort (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 3 months ago by snilsson
Modified:
14 years, 3 months ago
Reviewers:
CC:
r, r2, gri, golang-dev
Visibility:
Public.

Description

Sort: reduced stack depth to lg(n) in quickSort Doing the tail recursion elimination explicitly seems safer than leaving it to the compiler; the code is still clean and easy to understand.

Patch Set 1 #

Patch Set 2 : code review 3373041: Sort: reduced stack depth to lg(n) in quickSort #

Total comments: 1

Patch Set 3 : code review 3373041: Sort: reduced stack depth to lg(n) in quickSort #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -4 lines) Patch
M src/pkg/sort/sort.go View 1 2 1 chunk +12 lines, -4 lines 0 comments Download

Messages

Total messages: 8
snilsson
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change.
14 years, 3 months ago (2010-12-01 19:51:48 UTC) #1
r2
gri@golang.org is the right reviewer. -rob On Dec 1, 2010, at 11:51 AM, snilsson@nada.kth.se wrote: ...
14 years, 3 months ago (2010-12-01 19:54:23 UTC) #2
gri
http://codereview.appspot.com/3373041/diff/2001/src/pkg/sort/sort.go File src/pkg/sort/sort.go (right): http://codereview.appspot.com/3373041/diff/2001/src/pkg/sort/sort.go#newcode124 src/pkg/sort/sort.go:124: func quickSort(data Interface, a, b int) { I think ...
14 years, 3 months ago (2010-12-01 22:01:19 UTC) #3
snilsson
Cool, that also seems to shave off a few percents from the benchmarks. Would it ...
14 years, 3 months ago (2010-12-01 22:41:41 UTC) #4
gri
Let's change the breakpoint separately so that we have a clearly isolated CL where we ...
14 years, 3 months ago (2010-12-01 22:44:44 UTC) #5
snilsson
Hello r, r2, gri (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 3 months ago (2010-12-01 23:12:05 UTC) #6
gri
LGTM Thanks! - gri On Wed, Dec 1, 2010 at 3:12 PM, <snilsson@nada.kth.se> wrote: > ...
14 years, 3 months ago (2010-12-02 17:11:49 UTC) #7
gri
14 years, 3 months ago (2010-12-02 17:18:23 UTC) #8
*** Submitted as http://code.google.com/p/go/source/detail?r=5866a9db7a1d ***

Sort: reduced stack depth to lg(n) in quickSort

Doing the tail recursion elimination explicitly
seems safer than leaving it to the compiler;
the code is still clean and easy to understand.

R=r, r2, gri
CC=golang-dev
http://codereview.appspot.com/3373041

Committer: Robert Griesemer <gri@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b