Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Issue 2208903002: Use sse4.2 CRC32 instructions to hash when available. (Closed)

Created:
4 years, 4 months ago by mtklein_C
Modified:
4 years, 4 months ago
Reviewers:
herb_g, egdaniel, mtklein
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Use sse4.2 CRC32 instructions to hash when available. About 9x faster than Murmur3 for long inputs. Most of this is a mechanical change from SkChecksum::Murmur3(...) to SkOpts::hash(...). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208903002 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Committed: https://skia.googlesource.com/skia/+/4e97607d9a1cef66fac16f347c5ca813ec4f9515

Patch Set 1 #

Patch Set 2 : cmake #

Patch Set 3 : notes etc #

Patch Set 4 : speed #

Patch Set 5 : fix cmake #

Patch Set 6 : thread it through #

Patch Set 7 : de-murmur #

Patch Set 8 : streamline test #

Patch Set 9 : tweak a bit more #

Patch Set 10 : restore seed as option #

Patch Set 11 : rename #

Patch Set 12 : 3 at a time #

Patch Set 13 : move another #

Patch Set 14 : another way #

Patch Set 15 : missing #

Patch Set 16 : 32-bit #

Patch Set 17 : shh warnings #

Patch Set 18 : rebase #

Total comments: 2

Patch Set 19 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+228 lines, -145 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +8 lines, -0 lines 0 comments Download
M bench/ChecksumBench.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +6 lines, -5 lines 0 comments Download
M cmake/CMakeLists.txt View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M gyp/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -1 line 0 comments Download
M gyp/opts.gypi View 1 chunk +3 lines, -3 lines 0 comments Download
M include/private/SkChecksum.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +8 lines, -13 lines 0 comments Download
M src/core/SkChecksum.cpp View 1 2 3 4 5 1 chunk +0 lines, -47 lines 0 comments Download
M src/core/SkDescriptor.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M src/core/SkImageFilterCache.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M src/core/SkOpts.h View 1 2 3 4 5 6 7 8 9 11 12 13 1 chunk +6 lines, -0 lines 0 comments Download
M src/core/SkOpts.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -1 line 0 comments Download
M src/core/SkPaint.cpp View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M src/core/SkResourceCache.cpp View 1 2 3 4 5 6 2 chunks +4 lines, -4 lines 0 comments Download
M src/gpu/GrProgramDesc.h View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download
M src/gpu/GrResourceCache.cpp View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M src/gpu/batches/GrAADistanceFieldPathRenderer.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/effects/GrTextureStripAtlas.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/text/GrAtlasTextBlob.h View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M src/gpu/text/GrStencilAndCoverTextContext.h View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M src/gpu/vk/GrVkPipelineStateCache.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +3 lines, -2 lines 0 comments Download
A src/opts/SkChecksum_opts.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +130 lines, -0 lines 0 comments Download
A + src/opts/SkOpts_sse42.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -2 lines 0 comments Download
M src/pdf/SkPDFGraphicState.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M src/utils/SkWhitelistTypefaces.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M tests/ChecksumTest.cpp View 1 2 3 4 5 6 7 2 chunks +19 lines, -41 lines 0 comments Download
M tools/UrlDataManager.h View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 68 (54 generated)
mtklein_C
Hello old friend!
4 years, 4 months ago (2016-08-04 02:47:30 UTC) #46
mtklein
Greg, SkChecksum::Murmur3() was showing up hot on your profile right? Think you can patch this ...
4 years, 4 months ago (2016-08-04 12:07:08 UTC) #50
egdaniel
In general this looks good to me, but you should confirm with herb whose don't ...
4 years, 4 months ago (2016-08-05 19:45:00 UTC) #52
mtklein
https://codereview.chromium.org/2208903002/diff/340001/src/opts/SkChecksum_opts.h File src/opts/SkChecksum_opts.h (right): https://codereview.chromium.org/2208903002/diff/340001/src/opts/SkChecksum_opts.h#newcode44 src/opts/SkChecksum_opts.h:44: while (steps --> 0) { On 2016/08/05 19:45:00, egdaniel ...
4 years, 4 months ago (2016-08-05 20:16:37 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2208903002/340001
4 years, 4 months ago (2016-08-08 14:53:22 UTC) #55
commit-bot: I haz the power
There were warnings when CQ was processing your CL: * CQ is not running the ...
4 years, 4 months ago (2016-08-08 14:53:24 UTC) #56
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot on master.client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot/builds/375) Build-Ubuntu-GCC-Arm64-Debug-Android-Trybot on master.client.skia.compile (JOB_FAILED, ...
4 years, 4 months ago (2016-08-08 14:54:52 UTC) #58
herb_g
lgtm
4 years, 4 months ago (2016-08-08 15:37:55 UTC) #59
mtklein_C
rebase
4 years, 4 months ago (2016-08-08 15:43:27 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2208903002/360001
4 years, 4 months ago (2016-08-08 15:44:46 UTC) #63
commit-bot: I haz the power
There were warnings when CQ was processing your CL: * CQ is not running the ...
4 years, 4 months ago (2016-08-08 15:44:49 UTC) #64
commit-bot: I haz the power
There were warnings when CQ was processing your CL: * CQ is not running the ...
4 years, 4 months ago (2016-08-08 16:01:09 UTC) #65
commit-bot: I haz the power
Committed patchset #19 (id:360001) as https://skia.googlesource.com/skia/+/4e97607d9a1cef66fac16f347c5ca813ec4f9515
4 years, 4 months ago (2016-08-08 16:06:31 UTC) #67
fmalita_google_do_not_use
4 years, 4 months ago (2016-08-08 19:48:25 UTC) #68
Message was sent while issue was closed.
On 2016/08/08 16:06:31, commit-bot: I haz the power wrote:
> Committed patchset #19 (id:360001) as
> https://skia.googlesource.com/skia/+/4e97607d9a1cef66fac16f347c5ca813ec4f9515

Build failures:
https://build.chromium.org/p/client.skia/builders/Perf-Ubuntu-GCC-GCE-CPU-AVX...


FAILED: /b/work/skia/tools/../third_party/externals/llvm/out/bin/clang++ -MMD
-MF obj/tests/dm.ChecksumTest.o.d -DSK_INTERNAL -DSK_GAMMA_APPLY_TO_A8
-DQT_NO_KEYWORDS -DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1 -DSK_SUPPORT_GPU=0
-DSK_FORCE_DISTANCE_FIELD_TEXT=0 -DSK_HAS_GIF_LIBRARY -DSK_HAS_JPEG_LIBRARY
-DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_IS_BOT -DSK_CODEC_DECODES_RAW
-DSK_TEST_QCMS -DSK_SAMPLES_FOR_X -DSK_BUILD_FOR_UNIX -DSK_XML -DSK_DEBUG=1
-I../../../dm -I../../../gm -I../../../include/private -I../../../src/core
-I../../../src/effects -I../../../src/images -I../../../src/lazy
-I../../../src/utils -I../../../tools/debugger -I../../../tests
-I../../../include/client/android -I../../../src/effects/gradients
-I../../../src/pathops -I../../../src/pipe/utils -I../../../src/codec
-I../../../src/image -I../../../src/pdf -I../../../src/ports -I../../../src/sksl
-I../../../third_party/etc1 -I../../../tools/flags
-I../../../third_party/externals/jsoncpp/include -I../../../third_party/libpng
-I../../../include/c -I../../../include/config -I../../../include/core
-I../../../include/pathops -I../../../include/codec -I../../../include/android
-I../../../include/effects -I../../../include/images -I../../../include/ports
-I../../../third_party/qcms/src -I../../../src/sfnt -I../../../include/utils
-I../../../include/svg -I../../../experimental/svg/model -I../../../tools
-I../../../tools -I../../../tools/timer -I../../../include/xml
-I../../../experimental -I../../../include/gpu -I../../../src/gpu
-I../../../third_party/externals/zlib -fPIC -g -fno-exceptions -fstrict-aliasing
-Wall -Wextra -Winit-self -Wpointer-arith -Wsign-compare -Wvla
-Wno-unused-parameter -m64 -Werror -fsanitize=memory
-fno-sanitize-recover=memory
-fsanitize-blacklist=/b/work/skia/tools/xsan.blacklist -include
/b/work/skia/tools/xsan.blacklist -O1 -fsanitize-memory-track-origins
-Wstring-conversion -fno-omit-frame-pointer -fPIE -stdlib=libc++
-I/b/work/skia/tools/../third_party/externals/llvm/msan_out/include -std=c++11
-fno-threadsafe-statics -Wnon-virtual-dtor -Wno-unknown-warning-option
-Wno-deprecated -Wno-deprecated-register  -c ../../../tests/ChecksumTest.cpp -o
obj/tests/dm.ChecksumTest.o
../../../tests/ChecksumTest.cpp:41:24: error: use of undeclared identifier
'SkGoodHash'
    REPORTER_ASSERT(r, SkGoodHash()(( int32_t)4) ==  614249093);
                       ^
../../../tests/ChecksumTest.cpp:42:24: error: use of undeclared identifier
'SkGoodHash'
    REPORTER_ASSERT(r, SkGoodHash()((uint32_t)4) ==  614249093);
                       ^
2 errors generated.


Also, debug SampleApp crashes locally with 

../../include/gpu/GrResourceKey.h:135: fatal error:
"assert(fKey[kHash_MetaDataIdx] == GrResourceKeyHash(&fKey[kHash_MetaDataIdx] +
1, this->internalSize() - sizeof(uint32_t)))"

Powered by Google App Engine
This is Rietveld 408576698