mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
035f1b358a
* feat(exp,simd): adding SumAxB helpers * feat(exp,simd): adding MeanAxB and ClampAxB helpers * feat(exp,simd): adding MinAxB and MaxAxB helpers * refactor(exp,simd): group perf helper category + architecture * feat(exp,simd): adding ContainsAxB helpers * perf(exp,simd): cast to unsafe slice once * feat(exp,simd): call the right SIMD helper based on local architecture * chore: internal dependency linking * Update exp/simd/math.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * style: fix linter * style: fix linter * chore: enable simd in makefile * chore(ci): add simd package to test runs * chore(ci): add simd package to test runs only for go 1.26 * fix(simd): fix overflow * fix(simd): fix overflow and apply the same behavior than lo.Mean * doc(exp,simd): adding initial doc * refactor(simd): move intersect_avx2 and intersect_sse code into intersect_avx512 * fix(simd): call SSE fallback instead of lo.Sum for default helpers * feat(simd): cache simd features on package init to avoid repeated checks * perf(exp,simd): precompute length + improve code quality * perf(exp,simd): faster iteration for min/max value * test(exp,simd): adding benchmarks * test(exp,simd): adding benchmarks results * test(exp,simd): adding benchmarks results * doc(exp,simd): adding warning for overflows in SIMD operations * feat(exp,simd): adding more dispatch helpers * feat(exp,simd): adding SumBy variants * feat(exp,simd): adding MeanBy variants * fix(exp,simd): faster clamp * 💄 * doc(exp,simd): adding SumBy + MeanBy * fix(exp,simd): faster SIMD operations * chore(ci): enable the benchmarks temporary * chore(ci): display cpu architecture before running tests * chore(ci): github actions are hidding some useful stuffs * chore(ci): no SIMD VM available at Github during the weekend ??? * test(exp,simd): larger epsilon * oops * perf(exp,simd): faster iterations * doc(exp,simd): report last version of benchmarks * 💄 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
58 lines
2.0 KiB
Makefile
58 lines
2.0 KiB
Makefile
# Only build/test/lint exp/simd when Go version is >= 1.26 (requires goexperiment.simd)
|
|
GO_VERSION := $(shell go version 2>/dev/null | sed -n 's/.*go\([0-9]*\)\.\([0-9]*\).*/\1.\2/p')
|
|
GO_SIMD_SUPPORT := $(shell ver="$(GO_VERSION)"; [ -n "$$ver" ] && [ "$$(printf '%s\n1.26\n' "$$ver" | sort -V | tail -1)" = "$$ver" ] && echo yes)
|
|
|
|
build:
|
|
go build -v ./...
|
|
@if [ -n "$(GO_SIMD_SUPPORT)" ]; then cd ./exp/simd && GOEXPERIMENT=simd go build -v ./; fi
|
|
|
|
test:
|
|
go test -race ./...
|
|
@if [ -n "$(GO_SIMD_SUPPORT)" ]; then cd ./exp/simd && GOEXPERIMENT=simd go test -race ./; fi
|
|
watch-test:
|
|
reflex -t 50ms -s -- sh -c 'gotest -race ./...'
|
|
|
|
bench:
|
|
go test -v -run=^Benchmark -benchmem -count 3 -bench ./...
|
|
watch-bench:
|
|
reflex -t 50ms -s -- sh -c 'go test -v -run=^Benchmark -benchmem -count 3 -bench ./...'
|
|
|
|
coverage:
|
|
go test -v -coverprofile=cover.out -covermode=atomic ./...
|
|
go tool cover -html=cover.out -o cover.html
|
|
|
|
tools:
|
|
go install github.com/cespare/reflex@latest
|
|
go install github.com/rakyll/gotest@latest
|
|
go install github.com/psampaz/go-mod-outdated@latest
|
|
go install github.com/jondot/goweight@latest
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
go get -t -u golang.org/x/tools/cmd/cover
|
|
go install github.com/sonatype-nexus-community/nancy@latest
|
|
go install golang.org/x/perf/cmd/benchstat@latest
|
|
go install github.com/cespare/prettybench@latest
|
|
go mod tidy
|
|
|
|
# brew install hougesen/tap/mdsf
|
|
|
|
lint:
|
|
golangci-lint run --timeout 60s --max-same-issues 50 ./...
|
|
@if [ -n "$(GO_SIMD_SUPPORT)" ]; then cd ./exp/simd && golangci-lint run --timeout 60s --max-same-issues 50 ./; fi
|
|
# mdsf verify --debug --log-level warn docs/
|
|
lint-fix:
|
|
golangci-lint run --timeout 60s --max-same-issues 50 --fix ./...
|
|
@if [ -n "$(GO_SIMD_SUPPORT)" ]; then cd ./exp/simd && golangci-lint run --timeout 60s --max-same-issues 50 --fix ./; fi
|
|
# mdsf format --debug --log-level warn docs/
|
|
|
|
audit:
|
|
go list -json -m all | nancy sleuth
|
|
|
|
outdated:
|
|
go list -u -m -json all | go-mod-outdated -update -direct
|
|
|
|
weight:
|
|
goweight
|
|
|
|
doc:
|
|
cd docs && npm install && npm start
|