Code Monkey home page Code Monkey logo

Comments (4)

a2888409 avatar a2888409 commented on May 18, 2024

实际上protobuf支持的基本数据类型,thrift基本上也都支持,但是thrift额外支持了以下的容器类型
list(java.util.ArrayList)、set(java.util.HashSet)、map(java.util.HashMap),这点是protobuf不具备的。因此相对来说thrift支持了更丰富的数据结构,更易扩展。

from face2face.

liushunshun avatar liushunshun commented on May 18, 2024

thrift生成的对象文件里内容很多看起来很乱,修改也不方便,每次都要重新生成代码。很多情况我们vo对象都是自己写的,这样查看和修改都方便,然后对象转json再存取redis,相比thrift协议byte[]转对象 性能会差很多吗?大概相差多少呢?(刚学这方面的知识,非常感谢您的耐心解答)

from face2face.

a2888409 avatar a2888409 commented on May 18, 2024

个人认为对象转为bytep[]存储,二进制数据应该会更加紧凑,相对来说存储效率会高点。但是二进制缺点就是存储的数据必须要进行序列化反序列化,可读性较差。关于二者的性能差别,我也没有特意测试过,建议你可以针对存储空间、耗时自行做一个测试

from face2face.

liushunshun avatar liushunshun commented on May 18, 2024

非常感谢^_^

from face2face.

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.