Skip to content

Conversation

@michalmuskala
Copy link
Member

This is a first step to limiting recompilations in case a struct is used in a
module, the "parent module" of the struct changes, but struct definition itself
does not change.

Things left to do outside this PR:

  • provide module.__info__(:struct_md5)
  • take advantage of the new information in Mix.Compilers.Elixir
  • update mix xref task.

This is a first step to limiting recompilations in case a struct is used in a
module, the "parent module" of the struct changes, but struct definition itself
does not change.
@ericentin
Copy link
Contributor

Is module.__info__(:struct_md5) intended to be the md5 of the struct spec to be used to determine whether a struct's definition has changed? Perhaps phash2 would be acceptable for this use case and also perhaps more OTP-native?

@josevalim
Copy link
Member

@antipax phash2 main focus is a proper hash distribution, so it is useful on things such as HashDict. I think md5 will do a better job of avoiding collisions.

@josevalim
Copy link
Member

I have merged this manually but there is still a bit more of work to be done. We need to add struct_md5 and we need to consider it in the compiler. Thanks for the iniciative and the idea on this! ❤️

@josevalim josevalim closed this in 6ea055c Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants