-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Make DUB compatible with Common Gateway Interface #1750
Comments
I fully agree with you that this behaviour should be fixed. For your actual use case I am not sure wheter, even if the bug is fixed, single file packages (.d script) is a good idea. On every http request you still have the overhead of calling dub, creating different hashes, checking wheter the executable was already built and finally calling the executable. |
I recommend that this be closed. This is only an issue if you're recompiling on every request. The standard way to use CGI with D or any other compiled language is to compile the binary once. We don't want to add a new feature to accommodate nonstandard/suboptimal use cases. |
Assuming this is for individual D files that act as a dub package, what I assume is happening is that it is not caching the output. But even so, dub is slow. Its well out of scope of the given implementation to fire CGI requests via it. If you want to do it via the individual file route, I would recommend putting your own program above it (or even use dub as a library) and let it handle the caching for your use case if this is for POSIX. On Windows this would be a fools goal given process cost to startup. |
PR #1811 |
Fixed in master |
System information
Bug Description
This is a general problem with DUB,
It seems that DUB is recompiling/building a project every time it runs a .d script.
This is enormous problem when using DUB with CGI, since CGI is calling .d script every time a web page request happens.
DUB wastes lots of processor time, overall computer resources.
How to reproduce?
Expected Behavior
Would love to see DUB checking if .d script was already compiled/run before. (Just like in RDMD)
If it was compiled/ran previously - do not compile/build. Run the previous compiled script version.
Logs
The text was updated successfully, but these errors were encountered: