Skip to content

Slow hostname resolution on first call, possible to disable host info? #68

@marksto

Description

@marksto

Hi Peter!

I've noticed quite a while ago that calling the streams->telemere! fn to enable standard stream/s -> Telemere interop on JVM takes quite some time. It's 5 seconds on my dev machine. The problem is, when I do it unconditionally, upon my logger ns loading (as I think that this is the right way to enable such a thing), it slows down the REPL startup by that 5 seconds.

My working hypothesis was that it somehow ends up grabbing the hostname (i.e. calling (InetAddress/getLocalHost)), which is well known for taking that much time at the first call. If I make this call in advance, and then do the streams->telemere! call, the second one takes 0.385 ms.

But how does it end up making that hostname call? And why? Is there any way to avoid this? What if I don't even need this :host information in my signals in the first place, say when developing an app locally?

Any ideas on how to get around this issue are more than welcome! =)

Cheers,
Mark

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestinput welcomeLooking for feedback or ideas

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions