Giter Site home page Giter Site logo

Per Msg/Field Features about vtprotobuf HOT 2 OPEN

planetscale avatar planetscale commented on September 28, 2024 2
Per Msg/Field Features

from vtprotobuf.

Comments (2)

nockty avatar nockty commented on September 28, 2024

Hello @kevinconaway! I think ultimately there are two things that may actually be decoupled:

  1. add support for unsafe casting of string and []byte fields;
  2. have per-message / per-field features.

I think (1) is definitely interesting, but I would be curious about use cases for (2). Could you provide some?

Typically, for (1), we could think of adding an unsafe feature providing unsafe methods to unmarshal messages, which doesn't need (2). This would affect all fields of the message, which should be OK, shouldn't it? Presumably, the lifetime for all fields of the message should be the same? In my mind at least, when using memory pooling for instance, we release bytes for the whole message at the same time, but I could be missing some other use case. (I'm not familiar with all extensions from gogo.)

from vtprotobuf.

kevinconaway avatar kevinconaway commented on September 28, 2024

we could think of adding an unsafe feature providing unsafe methods to unmarshal messages, which doesn't need (2). This would affect all fields of the message, which should be OK, shouldn't it?

Not particularly for our use case. Our messages tend to have a lot of string data and most of them should be un-marshaled safely. It is only for a handful of fields that we opt to unmarshal them in an unsafe manner.

from vtprotobuf.

Related Issues (20)

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.