Open Dav1dde opened 11 years ago
How long does running
$ make config=tests
take?
Unfortunately compile time features can take a long time with dmd. I don't know what I can do within ddl to mitigate the problem. Profiling it is kind of difficult. Would it help if it was possible to store the generated code?
I can't use premake4 for the makefile and I can't get the linked version to work. But I don't think that it's my computer which takes that long.
Would it help if it was possible to store the generated code? Then you may only need to compile once?
The performance is here the same.
Mh, storing the compiled code, this could work, and instead of recompiling it, using import(path)
?
No. I have to do something to support it I think. Just need to know whether it would help in your case.
If it makes things faster and using less ram, it will definitly help. But I am at the moment in no real need to have ddl working, it woule be a great feauture though (using a combination of derelict, deimos and linking with dynamic libs atm.)
I think it won't. You would have to it once if the code does not change. I can look at the code to find places that make dmd's life hard. But this is very difficult as I have no idea where dmd spends its resources.
The problem is, with this compile times ddl is basically dead for me. Doing it once isn't a problem, since I can pack the generated code with my application.
I think I have found the problem. I'm looking for a fix right now.
I managed to reduce the resource consumption on my machine. Can you comment out the static assert in loadFunction
and unloadFunction
? Since these result in quadratic compile time in the number of extern(C) functions.
I used dmd 2.060.
This makes sense, staticIndexOf
finds the index in a recursive way so if there is a long list of arguments, the memory consumption can grow extremly.
I tried it and it's still slow, uses one core completly up and takes up to 25% memory (2GB)
So basically no change. Sadly I do not think that I am doing something horribly inefficient. Further the behavior that dmd uses too much memory and time for compile time features is also known for other projects (see e.g. https://github.com/PhilippeSigaud/Pegged/issues/98). Currently I have no idea how to attack this. Sorry.
Only solution is probably waiting... Seems like I have to do it manually. Thanks for your help!
Compiling this piece of code:
Takes several minutes to compile (dmd 2.061), uses up one core completly and also uses more than 2GB ram.
awesomium deimos bindings.