Okay, so based on the various replies I've gotten, it sounds like we want a 
patch that:

1) Completely rewrites the native code using newer APIs, and gets rid of the 
dual implementations that exist today (per Daniel Jelinski)
2) Gets rid of the homebrew interface naming scheme in favor of what the 
Windows API returns (per Alan Bateman)

Do we care about backwards compatibility for NetworkInterface#getByIndex() and 
getByName()? Based on my experiments, I don't think the indexes will actually 
change, but I can't 100% guarantee that. The names will definitely change 
though, per #2 above. How do we want to handle that? Do we just put something 
in the release notes saying there's a change that's not backwards-compatible? 
Or do we want to do a fallback to the existing naming scheme if the Windows API 
doesn't recognize a name? Or something else entirely, like a system property to 
toggle the behavior?


Rich DiCroce
Senior Advanced Solutions Architect

Scientific Games


HAVE FUN. DO GOOD. PLAY HEALTHY.
 May be privileged. May be confidential. Please delete if not the addressee.


-----Original Message-----
From: Daniel Fuchs <daniel.fu...@oracle.com> 
Sent: Wednesday, February 8, 2023 7:44 AM
To: DiCroce, Richard <rich.dicr...@scientificgames.com>; net-dev@openjdk.org
Subject: Re: Performance of NetworkInterface methods on Windows

WARNING: This is an external email. Do not click links or open attachments 
unless you recognize the sender and know the content is safe.


Hi Richard,

On 07/02/2023 21:04, DiCroce, Richard wrote:
> Hi Daniel,
> I'm not proposing to add any caching, or change anything about the Java side 
> of NetworkInterface, for exactly the reasons you state. This first patch is 
> purely a change to the native code to make it so that getAll only calls the 
> Windows API once instead of N + 1 times.

Oh, OK - good to hear. That sounds interesting then, sorry for assuming!
:-)

> createNetworkInterface actually already had parameters for passing the 
> previously fetched list of interfaces. getAll just doesn't currently do that.
>
> This would probably be easier to discuss if you could actually see the 
> changes I'm proposing. Should I attach a patch to an email, or is there a 
> better way of doing that?

Jaikiran replied with a good suggestion for that. But please take into account 
Daniel Jelinski's comments first.

best regards,

-- daniel

>
> Thanks,
>
> Rich DiCroce

Reply via email to