Giter VIP home page Giter VIP logo

Comments (5)

YetAnotherMinion avatar YetAnotherMinion commented on May 28, 2024 1

Added in 1.3.0

from diesel_geometry.

YetAnotherMinion avatar YetAnotherMinion commented on May 28, 2024

One limitation of the current API is I reuse the PgPoint type for the contents of more complex types like circle, polygon, etc...

For example, a PgCircle will get serialized to json as [[x, y], radius] and a PgBox will get serialized as [[px, py], [qx, qy]]. We are just trading additional overhead for simpler conceptually and simpler to parse.

What is your opinion for default derives on the complex types? My current position is to keep the design in the hope that users working in another language can use their libraries default derives for the type and not have to port the custom logic.

from diesel_geometry.

Boscop avatar Boscop commented on May 28, 2024

default derives is fine and I would also prefer that. No need to deviate from the default derives :)
Btw, which overhead do you mean? I don't think there's any overhead..

from diesel_geometry.

YetAnotherMinion avatar YetAnotherMinion commented on May 28, 2024

Serialization format will usually use more bytes. PgCircle for example will use two extra bytes for [] characters and PgBox would use an extra 4 bytes [][] when using more common serialization formats such as json or toml.

Fitting under a packet boundary can cause non linear savings.

from diesel_geometry.

Boscop avatar Boscop commented on May 28, 2024

If one is concerned about these small overheads, one shouldn't use json anyway..
And these serialized types will be part of larger serialized types anyway..
I don't think one should impl the serde traits to optimize the json representation, that's just one format of many and can be gzipped very well..

from diesel_geometry.

Related Issues (7)

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.