GithubHelp home page GithubHelp logo

cloudwego / dynamicgo Goto Github PK

View Code? Open in Web Editor NEW
125.0 13.0 22.0 6.14 MB

Dynamically and efficiently operate RPC data for Go

License: Apache License 2.0

Makefile 0.23% Python 0.34% Go 74.52% C 24.89% Shell 0.03%
dynamic-programming serdes reflection thrift

dynamicgo's People

Contributors

asterdy avatar ii64 avatar khan-yin avatar marina-sakai avatar sbs-copilot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamicgo's Issues

Proposal: support high-performance generic-call SDK for `protobuf` protocol

Background

Like Thrift, protobuf also needs a easy-to-use and high-performance generic-calling system in practice.

Goals

  • Implement a generic calling SDK based on protobuf protocol, supporting both server and client
  • Meet primary needs for generic calling, including routing (optional)、type-describing、protocol-conversion、dynamic-reflection (searching and serialization/deserialization)
  • High performance and wide compatiblity
  • (optional) Be compatible with dynamicgo's thrift/generic API in the aspect of dynamic reflection.

Alternatives

Desgin Advices

  • For type-describing, we could use official implementation, considering the compatibility. But this implementation will have some impact on performance (not sure) ?
  • For protocol-conversion, we can implement it using the way dynamicgo/conv does —— converting in place and sequentially, without any intermediator
  • For dynamic-reflection, we can still split it into two APIs -- searching (based on skipping) and serializing/deserializing (based on DOM). For searching, one important thing is the speed of skipping algorithm —— I'm afraid that varint encoding has big impact on it. For full-load serializing/deserializing, I want to keep the same memory model with Thrift's DOM, for future conversion of these two —— in application on DSL like GraphGL.

protobuf 增加从byte数组中读取指定数量field的函数

protobuf的编解码属于属于位置不可移动类型. 如果能确定编码的时候,某几个字段在生成的字节数组,那么,对于转发或者代理之类的网关,就可以不需要解码整个消息,之需要解码前面几个字段。

生成器生成protobuf代码的时候, 固定写入字段的顺序(编码),这是可以固定的。另外一个是, 在需要代理转发的地方,根据二进制直接读取前面需要的字段. 目前,dynamicgo中有comsumefixed64这样的方法可以读取用一个字段,是否可以增加,连续读取几个字段的方法呢

R_X86_64_PC32 against undefined symbol `github.com/cloudwego/dynamicgo/internal/native/avx2.__quote'

编译出错,
2023/10/24 22:11:24 go: downloading github.com/cloudwego/dynamicgo v0.1.3

2023/10/24 22:11:31 + export GO111MODULE=off
2023/10/24 22:11:31 + GO111MODULE=off
2023/10/24 22:11:31 + myfile=./vendor/golang.org/x/net/trace/trace.go
2023/10/24 22:11:31 + startLine=120
2023/10/24 22:11:31 + endLine=132
2023/10/24 22:11:31 + [[ linux-gnu =~ ^darwin ]]
2023/10/24 22:11:31 + '[' -f ./vendor/golang.org/x/net/trace/trace.go ']'
2023/10/24 22:11:31 + sed -i '120,132s/^////' ./vendor/golang.org/x/net/trace/trace.go
2023/10/24 22:11:31 + startLine=74
2023/10/24 22:11:31 + endLine=74
2023/10/24 22:11:31 + [[ linux-gnu =~ ^darwin ]]
2023/10/24 22:11:31 + '[' -f ./vendor/golang.org/x/net/trace/trace.go ']'
2023/10/24 22:11:31 + sed -i '74,74s/^////' ./vendor/golang.org/x/net/trace/trace.go
2023/10/24 22:11:31 + mkdir -p output
2023/10/24 22:11:31 + go build -buildmode=plugin -o ./output/stress.so main.go
2023/10/24 22:13:34 # command-line-arguments
2023/10/24 22:13:34 /usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
2023/10/24 22:13:34 /usr/bin/ld: /tmp/go-link-419334024/go.o: relocation R_X86_64_PC32 against undefined symbol `github.com/cloudwego/dynamicgo/internal/native/avx2.__quote' can not be used when making a shared object; recompile with -fPIC
2023/10/24 22:13:34 /usr/bin/ld: final link failed: Bad value
2023/10/24 22:13:34 collect2: error: ld returned 1 exit status

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.