[erlang-questions] Trying to understand the performance impact of binary:split/3
Fri May 22 12:41:30 CEST 2015
Thanks for the fantastic reply Jay, I will look into this stuff carefully.
Founder and Lead Developer
On Thu, May 21, 2015 at 9:56 PM, Jay Nelson <> wrote:
> Jose wrote:
> > I wonder how fast it would be if binary:split/3 was written as a BIF.
> I wrote a BIF in 2005 for manipulating binaries. It was documented in
> an ICFP presentation and ACM paper. You can read about it, the
> erlang code, and more importantly the actual BIF code at my website
> http://duomark.com/erlang/index.html listed under the title
> “A Stream Library Using Erlang Binaries”. There are separate links
> for the HTML Briefing and Code.
> From the abstract:
> "The new BIFs are shown to improve performance as much as 250
> times over native erlang functions. The reduction in memory usage
> caused by the BIFs also allows successful processing in situations
> that crashed the runtime as application functions."
> There is a gzip tar file that you used to be able to overlay on R10B(!!)
> to build the BIFs. But it is all contained in a single stream.c file and
> corresponding BIF table entries are in the other parts of the erts and
> beam directories there, so it should be easy to adapt to the current
> release you are working with. You should be able
> to quickly get into the source and see if it meets any of your needs.
> It will require some modification, and there are manual loop unrolling
> and so forth that I did for performance, but as a rough quick test of
> whether a BIF would be helpful this might be the quickest way to get
> If you do achieve interesting results, be sure to add reduction count
> bumping in the BIF. This code predates the option of doing that.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions