Subject: bug#78465: [PATCH] * src/lread.c (load): Try reuse the fd if it was opened in binary mode

From: Eli Zaretskii <[email-masked]>
Date: Sat, 17 May 2025 10:48:15 +0300

tags 78465 wontfix
thanks

> From: Lin Sun <[email-masked]>
> Date: Sat, 17 May 2025 07:09:06 +0000
> msip_labels: 
> 
> This patch will let Emacs avoid always close the fd then open the file with desired fmode in the "Fload" function on windows. It will reduce the counts on calling the "CreateFile" api.
> 
> On my dev windows environment, Emacs startup time reduces from 4.551s to 4.378s with 352 packages. 

Thanks, but I don't think we should install this.  fdopen on Windows
has all kinds of subtleties and idiosyncrasies, which is the reason
why we don't use fdopen here.  This code has seen several changes in
the past due to those problems, and I don't want to risk reintroducing
them again, certainly not for the benefit of a mere 3.8% reduction in
load time.  It just isn't worth the risk.

Sorry.