-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow DWG reader #63
Comments
Hi @gktval, That part of the code is quite messy and very delicate at the same time, Autodesk divides each object in 2 or 3 sections depending on the version, Also there is a About your improvement, if you have the code please create a PR pointing to this repo, I'll be happy to review it. Thanks! |
Hello, I have been trying to use this importer for a project. It worked great for small dwg file but the reading speed was so slow. I have been following the issues but didn't find anything that works for me. I tried what @gktval said works like a charm. It greatly increases the speed. I can create a pull request about this too. But I am nut sure if i sould create it or wait for @gktval . Great project @DomCR :D |
I read the other "slow" comment issues with regards to the CrcCheck. It looks like it is by default set to |
@Hexer611 If you make a PR, there are a few other problems I found. Do as you wish with them. Or @DomCR, if you prefer I can create separate Issues for each, but there are quite a few. In https://github.com/DomCR/ACadSharp/blob/master/ACadSharp/Entities/ViewPort.cs, FrozenLayers method is never initialized and will throw a NullReferenceException in the CadViewportTemplate. (so just add In https://github.com/DomCR/ACadSharp/blob/master/ACadSharp/Classes/DxfClassCollection.cs, the list 'Dictionary' will throw an exception if an item is added twice (which in my case, the dxf for some reason has two items the same). Not sure what to do here, my easy fix was to change line 19 to this: In the DxfReaderBase class, I get an InvalidCastException because this.LastValue is trying to convert a string into ULong in the LastValueAsHandle property. This is a result of the Those are the ones I remember at the moment. Thanks. |
I faced some of the errors you mentioned, but since I wasn't sure what to do about them. I will wait a response from @DomCR before creating a PR about the speed error and those bugs. Thanks for pointing them out :) |
To keep the things sorted I would prefer to have different issues and different branches for each one of it, that way is easier to stay on track and have the different updates isolated form other possible issues. About the creation of the branches:
Thanks a lot! |
You can try to read this 4MB file. I waited more than 10 minutes for this one |
I've tried the file, 10 min and throws an I'll work on the failsafe to avoid this kinds of errors and the performance enchantment. |
I've created a PR for this, if you want you can push your branch to that PR, I'll compare both solutions and merge it. |
Okay, I will push my changes to "issue-63_slow-dwg-reader". Edit: I don't have permission to do that, have I misunderstood you here? |
@Hexer611 push the changes to master then, thanks |
I created the pull request to the master. I checked the PR you created for this issue and you probably solved it by your commits, my PR is probably useless at this point :D I should mention that this is my first time contributing to a public project. I didn't even know about forking. I hope I didn't make any mistake creating the PR :D |
@Hexer611 don't worry, happy to have people working on this repo. I'll check you PR and allow you to merge, @gkval and you are the ones that spotted this issue so I'm happy to use your PR. Thank you both! |
Reading a dwg that is roughly 1400kb took 25 seconds to complete. I tracked down where the bottleneck was occurring and it happens in the DwgObjectSecionReader.cs. It seams that in every read loop, the stream gets copied at least 3 times in the getEntityType method. I changed this by creating a buffer in the initializer for the class and then creating a new memory stream from that buffer (that way the buffer only gets copied once when the class initializes). This reduced the read time to 500 ms. Just fyi. Great project.
The text was updated successfully, but these errors were encountered: