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

Issue 7222043: Avoid possible O(n) stack space use by skqsort. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 9 months ago by bungeman
Modified:
11 years, 9 months ago
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Avoid possible O(n) stack space use by skqsort.

Patch Set 1 #

Patch Set 2 : Move SkQSort towards SkIntroSort. #

Patch Set 3 : Correct level of indirection in SkTInsertionSort(T**, T**). #

Patch Set 4 : Remove duplicate code. #

Total comments: 6

Patch Set 5 : Comments and remove unwanted overload. #

Total comments: 4

Patch Set 6 : Use SkCLZ. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -89 lines) Patch
M src/core/SkRTree.h View 1 2 3 4 1 chunk +20 lines, -11 lines 0 comments Download
M src/core/SkRTree.cpp View 1 2 3 4 4 chunks +4 lines, -6 lines 0 comments Download
M src/core/SkTSort.h View 1 2 3 4 5 7 chunks +101 lines, -72 lines 0 comments Download

Messages

Total messages: 13
bungeman
This prevents using O(n) stack space in bad cases. It slows down the skqsort benches ...
11 years, 9 months ago (2013-01-25 21:58:37 UTC) #1
edisonn
I would vote to keep the same algorithm across all QSort implementations, thus extend 7397 ...
11 years, 9 months ago (2013-01-28 14:39:31 UTC) #2
reed1
Has the call-insertion-sort optimization been landed yet? If not, I'd prefer to land that first ...
11 years, 9 months ago (2013-01-28 14:54:30 UTC) #3
bungeman
Patch set 2 makes SkTQSort(T* left, T* right) very fast, O(lg(n)) storage worst bound, O(lg(n)) ...
11 years, 9 months ago (2013-01-28 21:52:30 UTC) #4
bungeman
Now with all of the duplicate sorting code removed.
11 years, 9 months ago (2013-01-29 16:15:51 UTC) #5
reed1
https://codereview.appspot.com/7222043/diff/12001/src/core/SkPictureStateTree.h File src/core/SkPictureStateTree.h (right): https://codereview.appspot.com/7222043/diff/12001/src/core/SkPictureStateTree.h#newcode38 src/core/SkPictureStateTree.h:38: uint32_t fOffset; Lets land this part now
11 years, 9 months ago (2013-01-29 16:30:32 UTC) #6
reed1
I think these are important enough, and subtle enough, that every function deserves a block-comment ...
11 years, 9 months ago (2013-01-29 16:35:43 UTC) #7
bungeman
Added comments and removed the function pointer wrapping version SkQSort. https://codereview.appspot.com/7222043/diff/12001/src/core/SkPictureStateTree.h File src/core/SkPictureStateTree.h (right): https://codereview.appspot.com/7222043/diff/12001/src/core/SkPictureStateTree.h#newcode38 ...
11 years, 9 months ago (2013-01-29 19:32:00 UTC) #8
reed1
https://codereview.appspot.com/7222043/diff/17001/src/core/SkRTree.h File src/core/SkRTree.h (right): https://codereview.appspot.com/7222043/diff/17001/src/core/SkRTree.h#newcode130 src/core/SkRTree.h:130: Do we need struct+operator, or can we just write ...
11 years, 9 months ago (2013-01-30 18:19:40 UTC) #9
bungeman
https://codereview.appspot.com/7222043/diff/17001/src/core/SkRTree.h File src/core/SkRTree.h (right): https://codereview.appspot.com/7222043/diff/17001/src/core/SkRTree.h#newcode130 src/core/SkRTree.h:130: On 2013/01/30 18:19:40, reed1 wrote: > Do we need ...
11 years, 9 months ago (2013-01-30 19:20:51 UTC) #10
reed1
On 2013/01/30 19:20:51, bungeman wrote: > https://codereview.appspot.com/7222043/diff/17001/src/core/SkRTree.h > File src/core/SkRTree.h (right): > > https://codereview.appspot.com/7222043/diff/17001/src/core/SkRTree.h#newcode130 > ...
11 years, 9 months ago (2013-01-30 20:42:12 UTC) #11
bungeman
Committed revision 7470. Issue with left >= right and SkNextPow2 resolved with revision 7474.
11 years, 9 months ago (2013-01-30 21:39:07 UTC) #12
robertphillips
11 years, 9 months ago (2013-01-31 16:17:26 UTC) #13
Message was sent while issue was closed.
This CL causes some minor images differences in the following layout tests (only
on Linux):

 svg/batik/text/smallFonts.svg [ ImageOnlyFailure ]
 svg/batik/text/textDecoration.svg [ ImageOnlyFailure ]
 svg/batik/text/textFeatures.svg [ ImageOnlyFailure ]
 svg/text/selection-styles.xhtml [ ImageOnlyFailure ]
Sign in to reply to this message.

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