Giter VIP home page Giter VIP logo

Comments (5)

khaf avatar khaf commented on June 13, 2024

Type Alias is a neat trick! Hadn't thought of it. Will be in the next release.

Regarding pre-packing, I'm aware of the implications. I agree with you on principle.

The reason why it is implemented in this way is that all bin values are preceded by a header indicating their size. I haven't been able to come up with a clean solution that would not require an intermediate buffer. What this implies is that the buffer that returns the packed array cannot be the same as the final buffer, since we need the result first to write the header.

I also do not want to call the packer twice, once for size estimation, and once to write the result to the buffer.

Thoughts?

from aerospike-client-go.

lming avatar lming commented on June 13, 2024

What I can think of is to write the header with 0 as size first (if the size field is in fixed length), then pack the value and get the length, and then go back to change the size field in the header. Not very clean but may work.

from aerospike-client-go.

khaf avatar khaf commented on June 13, 2024

The Value optimizations are in. Thanks for the tip.

I'll try to come up with a better solution for complex data types.

from aerospike-client-go.

lming avatar lming commented on June 13, 2024

Thanks for the improvements!

For NullValue, may want to avoid allocation (and avoid pointer) as well:
type NullValue struct{}
var nullValue NullValue
func NewNullValue() NullValue {
return nullValue
}

from aerospike-client-go.

khaf avatar khaf commented on June 13, 2024

Done.

from aerospike-client-go.

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.