Giter Site home page Giter Site logo

Parallelize processing about bson HOT 4 CLOSED

martimm avatar martimm commented on August 20, 2024
Parallelize processing

from bson.

Comments (4)

bbkr avatar bbkr commented on August 20, 2024

Buf bug is fixed.

I'm not sure if hyper >> still works as before because all parallel stuff has now Promises and Supplies.
Simple benchmark should show huge improvement.

from bson.

bbkr avatar bbkr commented on August 20, 2024

I've tried Promise approach.

method encode_e_list ( *@p --> Buf ) {
       return Buf.new unless @p;
       return [~](await do for @p { start { self.encode_element( $_ ) } } );
}

But it deadlocks. For example when encoding hash with 10 keys holding arrays of 10 elements everything works. But hash with 10 keys holding arrays of 20 elements uses all available threads and outer (encoding hash) or inner (encoding array elements) awaits won't complete because they are all half-way started.

I'm not sure what valid solution should look like.

from bson.

MARTIMM avatar MARTIMM commented on August 20, 2024

A new module BSON::Document is written to handle issues caused by using Hash. The main problem with hashes is changing the input order of key-value pairs. This is handled in the new module. Because it is written in pure perl it is much slower than using hashes which use also nqp.
The module also parallelize the encode and decode processes.

from bson.

MARTIMM avatar MARTIMM commented on August 20, 2024

After some time running the BSON::Document module I am rather satisfied with it. Perl6's speed has improved in the mean time and will continue to do so. Later I will decide if there can be any code improvements

from bson.

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.