DescriptionConvert SkWriter32 to use an SkTDArray for its internal storage.
This reduces the allocation overhead of a null picture (create, beginRecording(), endRecording) from about 18K to about 1.9K. (There's still lots more to prune.)
SkPictureFlat can exploit the fact that Writer32 is contiguous simplify its memory management. The Writer32 itself becomes the scratch buffer.
Remove lots and lots of arbitrary magic numbers that were size guesses and minimum allocation sizes. Keep your eyes open for the big obvious DUH why we save 16K per picture! (Spoiler alert. It's because that first save we issue in beginRecording() forces the old SkWriter32 to allocate 16K.)
Tests passing, DM passing.
bench --match writer: ~20% faster
null bench_record: ~30% faster
bench_record on buildbot .skps: ~3-6% slower, ranging 25% faster to 20% slower
bench_pictures on buildbot .skps: ~1-2% faster, ranging 13% faster to 28% slower
BUG=skia:1850
Committed: http://code.google.com/p/skia/source/detail?r=13073
Patch Set 1 #Patch Set 2 : DM ok now. #Patch Set 3 : Related cleanup. #Patch Set 4 : simplify readFromStream #Patch Set 5 : get rid of unused guesses #Patch Set 6 : add begin and detach and update tests #Patch Set 7 : tweak comment #Patch Set 8 : remove detach for now #Patch Set 9 : comments and tweaks #Patch Set 10 : remove SizeWithPadding #Patch Set 11 : update android-guarded write buffers #
Total comments: 3
Patch Set 12 : make reservePad less cryptic #Patch Set 13 : of course 0's fine too... #
Messages
Total messages: 6 (0 generated)
|