Giter Site home page Giter Site logo

Comments (4)

cloudwu avatar cloudwu commented on September 28, 2024

pbc lua decode 出来的 table 是惰性展开的。不支持迭代。

cjson.encode(t) 是错误的用法。

发自我的 iPad

在 2014年12月23日,上午10:08,XavierXia [email protected] 写道:

cjson.encode(t))

from pbc.

XavierXia avatar XavierXia commented on September 28, 2024

明白了。谢谢,也在您的博客上看到了相关文章,我准备试试您的sproto。

from pbc.

XavierXia avatar XavierXia commented on September 28, 2024

----- parse/decode size(Bytes) time(second) times
protobuf (binary to table) 117 9.6896359920502 1M万次
cjson (json str to json) 437 14.513430833817
pbc-lua (decode) nil 7.8595468997955

----- seri/encode size(Bytes) time(second) times
protobuf (table to binary) 117 6.0948710441589 1M万次
cjson (json to json str) 437 23.61823201179
pbc-lua (encode) 117 9.381726026535
测试数据如下:
{"segments":[{"type":1,"ct":1415384160,"ttl":1415384160,"id":100001}],"total":[{"value":1,"id":100188}],"pbid":[{"value":3,"id":100188},{"value":3,"id":100189},{"value":3,"id":100190}],"daily":[{"daily_id":1125,"date_id":[{"value":1,"id":100188}]},{"daily_id":1126,"date_id":[{"value":1,"id":100188}]}],"imp":[{"win":2,"bid":3,"time":8160,"id":100188},{"win":2,"bid":3,"time":8160,"id":100189},{"win":2,"bid":3,"time":8160,"id":100190}]}

我顺便做了一下测试,pbc-lua,protobuf 的lua部分均用luajit编译,您这个库的性能表现的很好。。

from pbc.

Think-Jumper avatar Think-Jumper commented on September 28, 2024

@XavierXia 请问你这个问题最终怎么解决的?我用的rapidjson,也遇到你这种问题

from pbc.

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.