Giter Site home page Giter Site logo

Comments (5)

 avatar commented on July 28, 2024 3

Interestingly, PYYAML, which inspired D-YAML can load the document twice faster.

$ git clone https://github.com/yaml/pyyaml
$ cd pyyaml
$ sudo python setup.py --without-libyaml install
$ python
Python 2.7.14 (default, Feb 17 2018, 10:42:17) 
[GCC 7.3.1 20180130 (Red Hat 7.3.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>stream = file('typeIDs.yaml', 'r')
>>>yaml.load(stream)

from d-yaml.

 avatar commented on July 28, 2024 1

The bottleneck is actually a complexity problem, here

void merge(ref Appender!(Node.Pair[]) pairs, ref Node.Pair toMerge) @trusted
{
    foreach(ref pair; pairs.data)
    {
        if(pair.key == toMerge.key){return;}
    }
    pairs.put(toMerge);
}

checking for equality has a terrible complexity. remove the check and the test case finishes in 6 secs (although being certainly wrong in regard of the content). This function is called in

Composer.Node composeMappingNode(const uint pairAppenderLevel, const uint nodeAppenderLevel)

from d-yaml.

 avatar commented on July 28, 2024

If anyone want to fight against this issue you have the yaml file here

from d-yaml.

 avatar commented on July 28, 2024

I've profiled with callgrind (3 hours to complete 😅 ).
Results are here: https://gist.github.com/BBasile/d8b9da00100a25ab411c89a8a0710582, and are much better than those from the built-in profiler. Use KCacheGrind to visualize.

from d-yaml.

Erikvv avatar Erikvv commented on July 28, 2024

Thanks for putting in the work.

from d-yaml.

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.