mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 00:52:18 +01:00
Optimize std/adler32 for SSE4.2
On a mid-range x86_64 laptop: wuffs_adler32_10k/clang9 1.35GB/s ± 0% 10.78GB/s ± 1% +700.65% (p=0.008 n=5+5) wuffs_adler32_100k/clang9 1.35GB/s ± 0% 12.88GB/s ± 0% +856.09% (p=0.008 n=5+5) wuffs_adler32_10k/gcc10 1.85GB/s ± 0% 11.21GB/s ± 0% +506.34% (p=0.008 n=5+5) wuffs_adler32_100k/gcc10 1.84GB/s ± 0% 11.43GB/s ± 0% +521.51% (p=0.008 n=5+5) mimic_adler32_10k 1.76GB/s ± 0% 1.76GB/s ± 0% ~ (p=0.841 n=5+5) mimic_adler32_100k 1.72GB/s ± 0% 1.72GB/s ± 0% ~ (p=0.222 n=5+5) wuffs_zlib_decode_10k/clang9 124MB/s ± 0% 139MB/s ± 0% +12.29% (p=0.016 n=4+5) wuffs_zlib_decode_100k/clang9 148MB/s ± 0% 155MB/s ± 0% +4.21% (p=0.008 n=5+5) wuffs_zlib_decode_10k/gcc10 133MB/s ± 1% 141MB/s ± 0% +5.75% (p=0.008 n=5+5) wuffs_zlib_decode_100k/gcc10 159MB/s ± 0% 172MB/s ± 0% +7.77% (p=0.016 n=5+4) mimic_zlib_decode_10k 133MB/s ± 0% 133MB/s ± 0% +0.38% (p=0.008 n=5+5) mimic_zlib_decode_100k 160MB/s ± 0% 160MB/s ± 0% ~ (p=0.841 n=5+5) wuffs_png_decode_image_19k_8bpp/clang9 90.6MB/s ± 0% 94.7MB/s ± 0% +4.58% (p=0.016 n=5+4) wuffs_png_decode_image_40k_24bpp/clang9 129MB/s ± 0% 135MB/s ± 0% +4.49% (p=0.008 n=5+5) wuffs_png_decode_image_77k_8bpp/clang9 335MB/s ± 0% 351MB/s ± 0% +4.62% (p=0.008 n=5+5) wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9 322MB/s ± 0% 320MB/s ± 1% -0.71% (p=0.016 n=4+5) wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9 256MB/s ± 0% 308MB/s ± 0% +20.24% (p=0.008 n=5+5) wuffs_png_decode_image_4002k_24bpp/clang9 131MB/s ± 0% 138MB/s ± 0% +5.24% (p=0.008 n=5+5) wuffs_png_decode_image_19k_8bpp/gcc10 95.1MB/s ± 0% 100.8MB/s ± 1% +6.08% (p=0.008 n=5+5) wuffs_png_decode_image_40k_24bpp/gcc10 131MB/s ± 0% 136MB/s ± 0% +3.65% (p=0.008 n=5+5) wuffs_png_decode_image_77k_8bpp/gcc10 350MB/s ± 1% 371MB/s ± 0% +6.06% (p=0.008 n=5+5) wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10 327MB/s ± 0% 333MB/s ± 0% +1.66% (p=0.008 n=5+5) wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10 274MB/s ± 0% 318MB/s ± 0% +15.93% (p=0.008 n=5+5) wuffs_png_decode_image_4002k_24bpp/gcc10 132MB/s ± 0% 138MB/s ± 0% +4.73% (p=0.008 n=5+5) mimic_png_decode_image_19k_8bpp 58.1MB/s ± 0% 58.2MB/s ± 0% +0.27% (p=0.008 n=5+5) mimic_png_decode_image_40k_24bpp 73.0MB/s ± 1% 73.3MB/s ± 0% +0.45% (p=0.008 n=5+5) mimic_png_decode_image_77k_8bpp 177MB/s ± 0% 177MB/s ± 0% ~ (p=0.421 n=5+5) mimic_png_decode_image_552k_32bpp_ignore_checksum skipped mimic_png_decode_image_552k_32bpp_verify_checksum 146MB/s ± 0% 146MB/s ± 0% ~ (p=0.310 n=5+5) mimic_png_decode_image_4002k_24bpp 104MB/s ± 0% 104MB/s ± 0% ~ (p=0.056 n=5+5)
This commit is contained in:
1 parent
cee57bc4ae
commit
b61a827354
5 files changed
+354
-15
No files matched your search
@@ -913,6 +913,17 @@ func (g *gen) forEachStatus(b *buffer, v visibility, f func(*gen, *buffer, *a.St
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g *gen) findAstFunc(qqid t.QQID) *a.Func {
|
||||
for _, file := range g.files {
|
||||
for _, tld := range file.TopLevelDecls() {
|
||||
if (tld.Kind() == a.KFunc) && (tld.AsFunc().QQID() == qqid) {
|
||||
return tld.AsFunc()
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g *gen) cName(name string) string {
|
||||
return cName(name, g.pkgPrefix)
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ func (g *gen) writeStatementChoose(b *buffer, n *a.Choose, depth uint32) error {
|
||||
if n.Name() == id {
|
||||
suffix = "__choosy_default"
|
||||
}
|
||||
caMacro, caName, _ := cpuArchCNames(g.funks[t.QQID{recv[0], recv[1], id}].astFunc.Asserts())
|
||||
caMacro, caName, _ := cpuArchCNames(g.findAstFunc(t.QQID{recv[0], recv[1], id}).Asserts())
|
||||
if caMacro == "" {
|
||||
b.printf("&%s%s__%s%s", g.pkgPrefix, recv.Str(g.tm), id.Str(g.tm), suffix)
|
||||
conclusive = true
|
||||
|
||||
Reference in new issue
Block a user