Closed PetarKirov closed 6 years ago
I think I have disabled the caching logic entirely because of problems I don't recall anymore and switched to NGINX's super-fast caching. That's why if you click run twice, the second time it will load sooo fast. I will look into this.
It's not an NGINX issue, otherwise X-Cached
would be part of the response.
I noticed that when I export the example from the start page and change the compiler to
dmd-nightly
(https://run.dlang.io/is/mO38pH), clicking on the AST button returns the LDC IR.I believe that the problem is in the caching code: https://github.com/dlang-tour/core/blob/8fc3f3aebae676a26b4db848c945ce18d8862451/source/exec/cache.d#L41-L57 uses only the source code (
input.source
) as a key in thesourceHashToOutput_
AA. Instead the wholeIExecProvider.RunInput
object should be used as the key type.We just need to make sure that if two
IExecProvider.RunInput
object are equal, but theirsource
members point to different pieces of memory (but with the same content) the default AA hash algorithm produces the same hash.