[erlang-questions] Crypto and ensure_loaded (maybe NIFs?)

Sverker Eriksson sverker.eriksson@REDACTED
Mon Oct 15 20:56:20 CEST 2012


That doesn't sound right. Could you supply some code to reproduce that?

/Sverker, Erlang/OTP

Fred Hebert wrote:
> While running some benchmarks and simulations on code that tends to 
> use crypto's sha functions quite a lot (in R15B02), I've noticed that 
> code that used them a lot tended to have bottlenecks within code_server.
>
> After a bit of tracing, I've found that code_server was receiving a 
> bunch of messages of the form:
>
> (<0.24.0>) in {code_server,loop,1} (Timestamp: {1350,315353,243397})
> (<0.24.0>) <0.227.0> ! {code_server,{module,crypto}} (Timestamp: 
> {1350,315353,
>                                                                   
> 243432})
>
> (<0.24.0>) out {code_server,loop,1} (Timestamp: {1350,315353,243438})
> (<0.24.0>) << {code_call,<0.227.0>,{ensure_loaded,crypto}} (Timestamp: 
> {1350,
>                                                                         
> 315353,
>                                                                         
> 243451})
>
> Which happened thousands of times per second. The crypto application 
> was indeed started, and a bunch of fresh processes would do many sha 
> calls per second.
>
> I'm wondering what's the underlying need for the code to do so many 
> calls to the code server to make sure it's loaded -- is it related to 
> NIFs in any way? If there's a way to work around that, it would help 
> me greatly.
>
> Regards,
> Fred.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list