Protocol consolidation

263 views
Skip to first unread message

José Valim

unread,
Oct 14, 2013, 5:40:51 AM10/14/13
to elixir-l...@googlegroups.com
Ladies and gentlemen,

Protocol consolidation is pushed to master. Consolidation works about checking all available implementations for a given protocol and re-compiling the protocol into a fast dispatch table. Once consolidated, a protocol loses its ability to dispatch to new types, but only the ones that were available during consolidation. For this reason, consolidation is ideal for test suites and production use.

For those who want to know more about it, please check the pull request:


So far, we don't provide a mix task nor a built-in way to consolidate protocols (we are still working on it). But for those who want to try consolidation today (and please do), here is a script that you can put into your project root directory and run it. Keep in mind that you will need:

* Recompile Elixir master from scratch (make clean compile)
* Recompile your project and its dependencies from scratch

Please give it a try and report bugs or any feedback you have!


José Valim
Skype: jv.ptec
Founder and Lead Developer

Peter Minten

unread,
Oct 14, 2013, 6:15:59 AM10/14/13
to elixir-l...@googlegroups.com
Just ran the noise bench referenced from the pull request, wow. I'm
seeing speedups of 90% on the protocol calls.

Great work Jos�!

On 10/14/2013 11:40 AM, Jos� Valim wrote:
> Ladies and gentlemen,
>
> Protocol consolidation is pushed to master. Consolidation works about
> checking all available implementations for a given protocol and
> re-compiling the protocol into a fast dispatch table. Once consolidated, a
> protocol loses its ability to dispatch to new types, but only the ones that
> were available during consolidation. For this reason, consolidation is
> ideal for test suites and production use.
>
> For those who want to know more about it, please check the pull request:
>
> https://github.com/elixir-lang/elixir/pull/1750
>
> So far, we don't provide a mix task nor a built-in way to consolidate
> protocols (we are still working on it). But for those who want to try
> consolidation today (and please do), here is a script that you can put into
> your project root directory and run
> it<https://gist.github.com/josevalim/eaecc46642887e6bf41c>.
> Keep in mind that you will need:
>
> * Recompile Elixir master from scratch (make clean compile)
> * Recompile your project and its dependencies from scratch
>
> Please give it a try and report bugs or any feedback you have!
>
>
> *Jos� Valim*
Reply all
Reply to author
Forward
0 new messages