Thread (37 messages) flat view 37 messages, 6 authors, 2016-06-15

Re: [PATCH] Add a new lstat and fstat implementation based on Win32 API

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:43:33

Possibly related (same subject, not in this thread)

Marius Storm-Olsen schrieb:
Johannes Sixt said the following on 04.09.2007 09:41:
quoted
Thanks a lot! I've pushed it out in mingw.git's master.
Ops, already in master branch?
Yes, it looked so polished ;)
http://repo.or.cz/w/git/mingw/4msysgit.git?a=commitdiff;h=f15974add93bdfa92775c77c00e7c65aefd42127 
Looks good, although you should now handle INVALID_HANDLE_VALUE at the 
beginning of git_fstat() like this:

	HANDLE fh = (HANDLE)_get_osfhandle(fd);
	if (fh == INVALID_HANDLE_VALUE)
		return -1;	/* errno has been set */

	if (GetFileInformationByHandle(...
Ok, I can give it a performance test, but I tend to agree with David 
Kastrup there. It would be better if we rather fix the places where we 
check with the local timestamp instead; depending of course on how many 
places we actually do this.
We'll see how much the timezone conversion in the custom stat functions 
actually hurt us performance wise.
I'd make the decision on the grounds of a perfomance test. If it turns out 
that the penalty is bearable, we should keep this stuff private to the MinGW 
build. Otherwise, we would need MinGW specific code at the call sites 
(unless we can hide the opposite conversion in some other wrapper function).

... time passes ...

Ok, I just tested FileTimeToLocalFileTime() in a tight loop, and I can run 
it 100,000,000 times per second. So I'm confident that there won't be any 
noticable degradation with my proposed change.

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help