Comments (5)
Added in 1.3.0
from diesel_geometry.
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.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diesel_geometry.