mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
name old speed new speed delta wuffs_jpeg_decode_19k_8bpp/clang11 365MB/s ± 1% 372MB/s ± 0% +1.77% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_progressive/clang11 241MB/s ± 0% 278MB/s ± 0% +15.49% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_sequential/clang11 477MB/s ± 0% 710MB/s ± 0% +48.91% (p=0.008 n=5+5) wuffs_jpeg_decode_77k_24bpp/clang11 429MB/s ± 0% 603MB/s ± 0% +40.56% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_420/clang11 446MB/s ± 0% 635MB/s ± 0% +42.18% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_444/clang11 644MB/s ± 0% 650MB/s ± 0% +1.06% (p=0.016 n=4+5) wuffs_jpeg_decode_4002k_24bpp/clang11 458MB/s ± 0% 629MB/s ± 0% +37.46% (p=0.008 n=5+5) wuffs_jpeg_decode_19k_8bpp/gcc10 352MB/s ± 0% 364MB/s ± 0% +3.62% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_progressive/gcc10 295MB/s ± 0% 334MB/s ± 0% +13.19% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_sequential/gcc10 669MB/s ± 0% 944MB/s ± 0% +41.07% (p=0.008 n=5+5) wuffs_jpeg_decode_77k_24bpp/gcc10 567MB/s ± 0% 769MB/s ± 0% +35.59% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_420/gcc10 605MB/s ± 0% 842MB/s ± 0% +39.07% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_444/gcc10 647MB/s ± 0% 661MB/s ± 0% +2.19% (p=0.008 n=5+5) wuffs_jpeg_decode_4002k_24bpp/gcc10 613MB/s ± 0% 849MB/s ± 0% +38.61% (p=0.008 n=5+5)
149 lines
3.6 KiB
Go
149 lines
3.6 KiB
Go
// Copyright 2021 The Wuffs Authors.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package cgen
|
|
|
|
import (
|
|
_ "embed"
|
|
"strings"
|
|
)
|
|
|
|
// EmbeddedString holds hand-written C/C++ code, exposed by this Go package by
|
|
// a "go:embed" directive.
|
|
type EmbeddedString string
|
|
|
|
// Trim removes the leading "Copyright etc" boilerplate.
|
|
func (e EmbeddedString) Trim() string {
|
|
s := string(e)
|
|
if strings.HasPrefix(s, "// Copyright ") {
|
|
if i := strings.Index(s, "\n\n"); i >= 0 {
|
|
s = s[i+2:]
|
|
}
|
|
}
|
|
return s
|
|
}
|
|
|
|
// ----
|
|
|
|
//go:embed base/all-impl.c
|
|
var embedBaseAllImplC EmbeddedString
|
|
|
|
// ----
|
|
|
|
//go:embed base/fundamental-private.h
|
|
var embedBaseFundamentalPrivateH EmbeddedString
|
|
|
|
//go:embed base/fundamental-public.h
|
|
var embedBaseFundamentalPublicH EmbeddedString
|
|
|
|
//go:embed base/memory-private.h
|
|
var embedBaseMemoryPrivateH EmbeddedString
|
|
|
|
//go:embed base/memory-public.h
|
|
var embedBaseMemoryPublicH EmbeddedString
|
|
|
|
//go:embed base/image-private.h
|
|
var embedBaseImagePrivateH EmbeddedString
|
|
|
|
//go:embed base/image-public.h
|
|
var embedBaseImagePublicH EmbeddedString
|
|
|
|
//go:embed base/io-private.h
|
|
var embedBaseIOPrivateH EmbeddedString
|
|
|
|
//go:embed base/io-public.h
|
|
var embedBaseIOPublicH EmbeddedString
|
|
|
|
//go:embed base/range-private.h
|
|
var embedBaseRangePrivateH EmbeddedString
|
|
|
|
//go:embed base/range-public.h
|
|
var embedBaseRangePublicH EmbeddedString
|
|
|
|
//go:embed base/strconv-private.h
|
|
var embedBaseStrConvPrivateH EmbeddedString
|
|
|
|
//go:embed base/strconv-public.h
|
|
var embedBaseStrConvPublicH EmbeddedString
|
|
|
|
//go:embed base/token-private.h
|
|
var embedBaseTokenPrivateH EmbeddedString
|
|
|
|
//go:embed base/token-public.h
|
|
var embedBaseTokenPublicH EmbeddedString
|
|
|
|
// ----
|
|
|
|
//go:embed base/floatconv-submodule-code.c
|
|
var embedBaseFloatConvSubmoduleCodeC EmbeddedString
|
|
|
|
//go:embed base/floatconv-submodule-data.c
|
|
var embedBaseFloatConvSubmoduleDataC EmbeddedString
|
|
|
|
//go:embed base/intconv-submodule.c
|
|
var embedBaseIntConvSubmoduleC EmbeddedString
|
|
|
|
//go:embed base/magic-submodule.c
|
|
var embedBaseMagicSubmoduleC EmbeddedString
|
|
|
|
//go:embed base/pixconv-submodule-regular.c
|
|
var embedBasePixConvSubmoduleRegularC EmbeddedString
|
|
|
|
//go:embed base/pixconv-submodule-x86-avx2.c
|
|
var embedBasePixConvSubmoduleX86Avx2C EmbeddedString
|
|
|
|
//go:embed base/pixconv-submodule-ycck.c
|
|
var embedBasePixConvSubmoduleYcckC EmbeddedString
|
|
|
|
//go:embed base/utf8-submodule.c
|
|
var embedBaseUTF8SubmoduleC EmbeddedString
|
|
|
|
// ----
|
|
|
|
//go:embed auxiliary/base.cc
|
|
var EmbeddedString_AuxBaseCc EmbeddedString
|
|
|
|
//go:embed auxiliary/base.hh
|
|
var EmbeddedString_AuxBaseHh EmbeddedString
|
|
|
|
//go:embed auxiliary/cbor.cc
|
|
var embedAuxCborCc EmbeddedString
|
|
|
|
//go:embed auxiliary/cbor.hh
|
|
var embedAuxCborHh EmbeddedString
|
|
|
|
//go:embed auxiliary/image.cc
|
|
var embedAuxImageCc EmbeddedString
|
|
|
|
//go:embed auxiliary/image.hh
|
|
var embedAuxImageHh EmbeddedString
|
|
|
|
//go:embed auxiliary/json.cc
|
|
var embedAuxJsonCc EmbeddedString
|
|
|
|
//go:embed auxiliary/json.hh
|
|
var embedAuxJsonHh EmbeddedString
|
|
|
|
var EmbeddedStrings_AuxNonBaseCcFiles = []EmbeddedString{
|
|
embedAuxCborCc,
|
|
embedAuxImageCc,
|
|
embedAuxJsonCc,
|
|
}
|
|
|
|
var EmbeddedStrings_AuxNonBaseHhFiles = []EmbeddedString{
|
|
embedAuxCborHh,
|
|
embedAuxImageHh,
|
|
embedAuxJsonHh,
|
|
}
|