XTLS / Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
https://t.me/projectXray
Mozilla Public License 2.0
25.47k stars 3.94k forks source link

xray-linux-amd64-avx #3057

Closed netsupcloud closed 8 months ago

netsupcloud commented 8 months ago

add xray-linux-amd64-avx in releases

This version is likely optimized for AMD64 architecture with support for Advanced Vector Extensions (AVX). AVX is an extension to the x86 instruction set architecture, and it introduces new instructions for vectorized floating-point and integer arithmetic operations.

thanks in advance

Fangliding commented 8 months ago

According to our test, there is almost no difference in performance, so not planned If you do find any performance improvement, please report to us and we will consider it again

netsupcloud commented 8 months ago

optimized version for Dedicated and Virtual servers with AVX support

netsupcloud commented 8 months ago

According to our test, there is almost no difference in performance, so not planned If you do find any performance improvement, please report to us and we will consider it again

its better to be planned because you dont know when app will be optimized when the code is changed after each update and im sure you dont want test after any update. we only update our apps not compilers.

netsupcloud commented 8 months ago

In Go, the math/rand package provides pseudorandom number generation. While the standard library doesn't have explicit AVX support for random number generation, you can use SIMD instructions with a library like github.com/minio/simdjson-go to demonstrate the concept. This library uses AVX for efficient JSON parsing

a lot of people will do pull request and you want check each one to which pull request is using a library that uses AVX ?

netsupcloud commented 8 months ago

module github.com/xtls/xray-core

go 1.22

require ( github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 github.com/golang/mock v1.7.0-rc.1 github.com/google/go-cmp v0.6.0 github.com/gorilla/websocket v1.5.1 github.com/miekg/dns v1.1.58 github.com/pelletier/go-toml v1.9.5 github.com/pires/go-proxyproto v0.7.0 github.com/quic-go/quic-go v0.41.0 github.com/refraction-networking/utls v1.6.3 github.com/sagernet/sing v0.3.2 github.com/sagernet/sing-shadowsocks v0.2.6 github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb github.com/stretchr/testify v1.8.4 github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e github.com/vishvananda/netlink v1.2.1-beta.2.0.20230316163032-ced5aaba43e3 github.com/xtls/reality v0.0.0-20231112171332-de1173cf2b19 go4.org/netipx v0.0.0-20231129151722-fdeea329fbba golang.org/x/crypto v0.19.0 golang.org/x/net v0.21.0 golang.org/x/sync v0.6.0 golang.org/x/sys v0.17.0 golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 google.golang.org/grpc v1.62.0 google.golang.org/protobuf v1.32.0 gvisor.dev/gvisor v0.0.0-20231104011432-48a6d7d5bd0b h12.io/socks v1.0.3 lukechampine.com/blake3 v1.2.1 )

require ( github.com/andybalholm/brotli v1.1.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect github.com/francoispqt/gojay v1.2.13 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/pprof v0.0.0-20240225044709-fd706174c886 // indirect github.com/klauspost/compress v1.17.7 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/onsi/ginkgo/v2 v2.15.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect github.com/vishvananda/netns v0.0.4 // indirect go.uber.org/mock v0.4.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.18.0 // indirect golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect )

netsupcloud commented 8 months ago

golang.org/x/crypto:

Cryptographic libraries often benefit from SIMD instructions for optimizing encryption and hashing algorithms. lukechampine.com/blake3:

Blake3 is a cryptographic hash function, and it's possible that it could leverage SIMD instructions for performance. github.com/cloudflare/circl:

This library is maintained by Cloudflare, and cryptographic libraries from security-focused companies may use SIMD instructions.

github.com/klauspost/compress:

Compression libraries (klauspost/compress) may use SIMD instructions for accelerating compression and decompression operations.

Fangliding commented 8 months ago

The text generated by AI is obviously not enough as a reason, and it cannot even answer our group's joining question correctly. Don't stick a lot of its answers anymore, it will appear that you lack basic knowledge Using SMID usually requires manual optimization, and I don't think we would have such pull requests. Most of this project is also difficult to vectorize, and the algorithm part is not maintained by us

netsupcloud commented 8 months ago

its not related to AI it means your answer is anywhere even if all libraries are open source you dont waste your time to check all of them you do ?

Fangliding commented 8 months ago

@netsupcloud I just compiled it (which will include all the dependent libraries) and tested efficiency. The conclusion is that there is no difference, and I said that there is unlikely to change in the future (and why, if you understand what I said)

netsupcloud commented 8 months ago

you right that compiled it with all dependent libraries but did you test all functionalities of those libraries at same time ? for example all type of encryption and decryption for shadowsocks ?

Fangliding commented 8 months ago

@netsupcloud I did

netsupcloud commented 8 months ago

ok