[erlang-questions 33] HiPE or native....good results, but confused...
Evans, Matthew
mevans@REDACTED
Sat Mar 26 20:56:12 CET 2011
Hi,
If anyone has been following the Sudoku email thread started by Andreas, I suggested he looked at compiling his code with the "native" flag set. With his app, and some common Erlang modules compiled to be native (espc. lists, sets and dict) I got a 2x performance improvement (see below).
I hadn't really played with HiPE (native) much, as I was always under the impression that performance gains were negligible. Clearly, for this use case, the gains are far from negligible - a 2x boost is not something to ignore.
My questions, simply put are:
1) When should HiPE be used?
2) When shouldn't HiPE be used?
3) What are the disadvantages of using HiPE?
4) Shouldn't "team Erlang" be doing more to promote its use?
5) Are any HiPE changes on the road-map?
Thanks
Matt
Results.....
Without native set:
18> c(sudoku).
{ok,sudoku}
19> sudoku:print_results("top95.txt", "\n").
Solved 95 of 95 puzzles from top95.txt in 2.038825 secs (46.60 Hz)
(922678 total eliminations, avg 9712.40, median 6596, max 55370, min 1797).
ok
With native set:
20> c(sudoku,[native]).
{ok,sudoku}
> sudoku:print_results("top95.txt", "\n").
Solved 95 of 95 puzzles from top95.txt in 1.613416 secs (58.88 Hz)
(922678 total eliminations, avg 9712.40, median 6596, max 55370, min 1797).
ok
Dict/lists/sets native too:
5> sudoku:print_results("top95.txt", "\n").
Solved 95 of 95 puzzles from top95.txt in 0.996860 secs (95.30 Hz)
(922678 total eliminations, avg 9712.40, median 6596, max 55370, min 1797).
ok
More information about the erlang-questions
mailing list