KiloG
KiloG
这在dp的分类下是不是搞错了。
``` func removeDuplicates(nums []int) int { RETRY: for i:=0;i
每天一杯小拿铁
This feature is the biggest gap between olivere and the official lib
Maybe return an error while input is an empty slice🤣
> > > > 例子是错误的,全局变量顺序一致性肯定能保证的 请问有相关资料可以说明吗
``` type Pad struct { a uint64 _p1 [cpu.CacheLinePadSize - unsafe.Sizeof(uint64(1))%cpu.CacheLinePadSize]byte b uint64 _p2 [cpu.CacheLinePadSize - unsafe.Sizeof(uint64(1))%cpu.CacheLinePadSize]byte c uint64 _p3 [cpu.CacheLinePadSize - unsafe.Sizeof(uint64(1))%cpu.CacheLinePadSize]byte } ``` 用这种形式获取padding大小更准确,Mac m1的CacheLinePadSize是128,并不是传统x86的64字节。 ``` package cpu...
``` goos: darwin goarch: arm64 pkg: go-praitce/go/app/benchmark/cachelinepadding BenchmarkPad_Increase BenchmarkPad_Increase-8 15356199 73.22 ns/op BenchmarkNoPad_Increase BenchmarkNoPad_Increase-8 13037071 94.33 ns/op PASS ``` 附上m1的测试结果
> build error on mac m1 Me too, at 2020 MacBook Pro, It seems that sonic is only support on amd64platform