[Issue 23793] std.stdio.openNetwork should be refactored and moved to a different place

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 18 20:18:29 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23793

--- Comment #2 from Witold Baryluk <witold.baryluk+d at gmail.com> ---
> If you just delete it, what improvements to do you see on import speed and linking compatibility?

In terms of speed.

It appears essentially none actually.

The reason is that all the transitive imports are done inside
`std.stdio.openNetwork`, and D compiler does not import them, unless it needs
to compile `openNetwork` function itself. But this function is already compiled
as part of Phobos, so compiler just uses it, with doing semantic or codegen on
this function. Still it needs to read `stdio.d` with it. Not a lot.

In terms of compatibility, it was working before, now with this function
present, I get things like this:

/build/gcc-12-bTRWOB/gcc-12-12.2.0/build/x86_64-linux-gnu/libphobos/src/../../../../src/libphobos/src/std/stdio.d:5860:
warning: Using 'gethostbyname' in statically linked applications requires at
runtime the shared libraries from the glibc version used for linking


Even if this was not the case, I think it is worth moving `openNetwork`
somewhere else.

--


More information about the Digitalmars-d-bugs mailing list