[erlang-questions] HiPE and large number of string cases

Kostis Sagonas kostis@REDACTED
Mon Jul 2 10:16:27 CEST 2007


Peter Wang wrote:
> On 2007-07-02, Kostis Sagonas <kostis@REDACTED> wrote:
>>  I cannot reproduce your findings with the latest OTP release (R11B-5). I've 
>>  created two such functions, one with 500+1 cases and one with 1000+1 cases, 
>>  and the times I get indeed show that there is a non-linear component 
>>  somewhere in the native code compiler, but it is nowhere as bad as you 
>>  describe.
>>
>>  2> timer:tc(hipe, c, [{t,f500,1}]).
>>  {7211870,{ok,{t,f500,1}}}
>>  3> timer:tc(hipe, c, [{t,f1000,1}]).
>>  {21001894,{ok,{t,f1000,1}}}
>>
>>  For me, native code compilation on an x86 running Linux takes about 7.2 secs 
>>  for 500 cases and 21 secs for 1000.  With optimization level o1 these times 
>>  are smaller.
> 
> Hmm, I can confirm that with an artificial test case using strings like
> "a1", "a2, etc.  Perhaps it has to do with the strings themselves?
> 
>>  Which OTP version are you using?  What platform is this?
> 
> I am using R11R-3 on Linux/x86_64.
> 
>>  If you are not using R11B-5, can you try with that and tell us what's 
>>  happening.
> 
> I will do that.  If the problem persists, would you mind if I sent you
> the test case?

Of course not.  As a matter of fact, why don't you send it anyway? (off 
the list).

Kostis



More information about the erlang-questions mailing list