Giter Club home page Giter Club logo

Comments (2)

JoeLoser avatar JoeLoser commented on June 26, 2024

Can you help me understand more about what you mean? Reg-passable types aren't going to be a thing controlled as they are now. When we adopt small buffer optimization to list, it's reasonable for it to just be a parameter (just like how the SSO size could be controlled at the String type parameter level). In which case, there won't be anything concrete to do here for this once all of Gabriel's SSO/SBO work lands.

from mojo.

martinvuyk avatar martinvuyk commented on June 26, 2024

Sorry I'll try to explain a good use case:

Say you have a char field and you know it's going to be mostly 48 byte strings, so classic 32 byte SBO for string doesn't cut it. You want an array that can handle custom and flexible SBO.

Say you then look at List's comming SBO that lets you add a buffer and when the item extends that buffer beyond capacity you have to deal with two different pointers, one for the SB and the other for the heap. If you have 3 typical lenghts (e.g. 48, 24, 16 bytes) you are dealing with, you will have to choose the biggest size for SBO and eat up the memory cost.

Following the example of having 48, 32, 24, 16 possiblities, say 25% for each. If you had a structure (the proposed Array) that has 5 transitions i.e. Array[UInt8, 16, 8, 48] for which each item is sized with the smallest fitting capacity, you wouldn't waste quite so much memory.

Another thing which is why the original Idea came up, is that there is no clear way to go from a List[Scalar] (other than iterating and loading, and knowing about its existence) to a SIMD vector. If Array could shift to internally using SIMD instead of the current inlineArray and List as heap, and be a user friendly interface for SIMD and vectorized ops.. that would be even better. Is there something like it already in the works? If so I'll just close the PR np

from mojo.

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.