sub binary use is non-optimal #42

Closed
taybin opened this Issue Aug 30, 2012 · 3 comments

Projects

None yet

2 participants

@taybin

After compiling with ERL_COMPILER_OPTIONS=bin_opt_info set for binary use warnings, this was printed.

It might be good to fix these.

src/erlydtl_filters.erl:211: Warning: INFO: using the original binary variable in a guard will prevent delayed sub binary optimization
src/erlydtl_filters.erl:213: Warning: NOT OPTIMIZED: sub binary used by erlang:binary_to_list/1
src/erlydtl_filters.erl:407: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:892: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:894: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:896: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:898: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:900: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:902: Warning: INFO: using a matched out sub binary will prevent delayed sub binary optimization
src/erlydtl_filters.erl:937: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:939: Warning: INFO: using a matched out sub binary will prevent delayed sub binary optimization
src/erlydtl_filters.erl:968: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:970: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:972: Warning: INFO: using a matched out sub binary will prevent delayed sub binary optimization
src/erlydtl_filters.erl:988: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:990: Warning: INFO: using a matched out sub binary will prevent delayed sub binary optimization
src/erlydtl_filters.erl:1118: Warning: INFO: using a matched out sub binary will prevent delayed sub binary optimization
src/erlydtl_filters.erl:1120: Warning: NOT OPTIMIZED: sub binary is used or returned
src/erlydtl_filters.erl:1122: Warning: NOT OPTIMIZED: sub binary is used or returned

@evanmiller

Why should these be fixed? I don't really care about warnings unless I know what they mean.

@taybin

Apparently it's possible to lazy evaluate binaries (http://www.erlang.org/doc/efficiency_guide/binaryhandling.html). I'm pretty newb in this area, but I thought you'd like to know and maybe see if any of them could be improved.

@evanmiller

Thanks for the information. Improving it is a waste of time unless this proves to be a significant bottleneck in the rendering process. Closing the issue.

@evanmiller evanmiller closed this Jan 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment