Comments (5)
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.
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.
If anyone want to fight against this issue you have the yaml file here
from d-yaml.
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.
Thanks for putting in the work.
from d-yaml.
Related Issues (20)
- Try to eliminate the Resolver regexes HOT 1
- serializer fails to find an anchor name in some cases
- Loss of precision when representing reals HOT 1
- Can I tell the dumper not to emit the !!str when it's a quoted string scalar? HOT 3
- Node as/get fails on struct types containing arrays of structs. HOT 1
- Expose Node Mark data outside of package
- core.exception.AssertError: prefixBytes out of bounds HOT 3
- D-Yaml chokes on tabs when in flow style HOT 5
- `get!T` does not work when `T` is a class with non-`inout` constructor HOT 1
- double is a better then real HOT 9
- yaml test suite action currently fails HOT 1
- Use of std.sumtype.SumType instead of std.variant.Algebraic HOT 1
- Feature Request: JSON-compatible dumper settings HOT 5
- `null`-initialized string is dumped as `null` rather than an empty string
- Unclear API for `Emitter` constructor HOT 1
- Remove copy of std.sumtype
- D-YAML does not support escaped slashes in strings HOT 5
- Multiline string that does not end with newline is accidentally parsed as a string that ends with `'\0'` HOT 1
- DIP1000-related deprecation with DMD 2.101
- Assertion failure when scanning simple document
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d-yaml.