GithubHelp home page GithubHelp logo

Comments (2)

andreasvc avatar andreasvc commented on June 11, 2024

You wouldn't use a .h file, but a .pxd file. See http://docs.cython.org/en/latest/src/userguide/sharing_declarations.html

A RoaringBitmap object is a Python object, implemented with a cdef class, and until now I only exposed it with a Python API. Therefore, any operation you do with it has to go through Python, and there is (as far as I understand) almost nothing to be gained from static typing and cimporting RoaringBitmap from Cython headers in a .pxd file. In particular, as I recall, even cdef functions of a cdef class still go through the Python API, because they are part of a Python object, so for a Cython API to make sense, one would need to avoid using the cdef class.

What would need to happen for this to make sense is that it should be decided which functions will be exposed as a public Cython API, and these cdef functions and structs should then be listed in a .pxd file. However, I'm not sure whether it is worth the effort. In general, it's always good to profile to identify bottlenecks before investing time in a potentially complicated change like this.

from roaringbitmap.

remiadon avatar remiadon commented on June 11, 2024

Agreed, .pyx file, not .h, I got confused

Now, from what I understand, the way to do it would be to define a _RoaringBitmap cdef struct, which would be an attribute inside the RoaringBitmap cdef class (just like you do for Block), and then expose cdef functions taking pointers on this struct as arguments.

Anyway I understand this seems complicated and gives no guarantee over potential speedups.

Thank you

from roaringbitmap.

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.