login
Header Space

 
 

Re: I'm a total push-over..

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Schindelin <Johannes.Schindelin@...>
Cc: Junio C Hamano <gitster@...>, Git Mailing List <git@...>
Date: Wednesday, January 23, 2008 - 12:25 pm

On Wed, 23 Jan 2008, Johannes Schindelin wrote:

Actually, it's going to be totally invisible even with UTF-8 
normalization, because we're going to do it sanely.

And by "sanely" I mean just having the code test the high bit, and using 
US-ASCII as-is (possibly with that " & ~0x20 " thing to ignore case in 
it).

End result: practically all projects will never notice anything at all for 
99.9% of all files. One extra well-predicted branch, and a few more hash 
collissions for cases where you have both "Makefile" and "makefile" etc.

Doing names with *lots* of UTF-8 characters will be rather slower. It's 
still not horrible to do if you do it the smart way, though. In fact, it's 
pretty simple, just a few table lookups (one to find the NFD form, one to 
do the upcasing).

And yes, for hashing, it makes sense to turn things into NFD because it's 
generally simpler, but the point is that you really don't actually modify 
the name itself at all, you just hash things (or compare things) character 
by expanded character.

IOW, only a total *moron* does Unicode name comparisons with

	strcmp(convert_to_nfd(a), convert_to_nfd(b));

which is essentially what Apple does. It's quite possible to do

	utf8_nfd_strcmp(a,b)

and (a) do it tons and tons faster and (b) never have to modify the 
strings themselves. Same goes (even more) for hashing.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
I'm a total push-over.., Linus Torvalds, (Tue Jan 22, 7:37 pm)
Re: I'm a total push-over.., Andreas Ericsson, (Wed Jan 23, 4:32 am)
Re: I'm a total push-over.., Linus Torvalds, (Wed Jan 23, 12:06 pm)
Re: I'm a total push-over.., Dmitry Potapov, (Wed Jan 23, 5:15 am)
Re: I'm a total push-over.., Andreas Ericsson, (Wed Jan 23, 5:31 am)
Re: I'm a total push-over.., Dmitry Potapov, (Wed Jan 23, 1:10 pm)
Re: I'm a total push-over.., Andreas Ericsson, (Thu Jan 24, 6:39 am)
Re: I'm a total push-over.., Marko Kreen, (Wed Jan 23, 10:01 am)
Re: I'm a total push-over.., Andreas Ericsson, (Wed Jan 23, 10:39 am)
Re: I'm a total push-over.., Marko Kreen, (Thu Jan 24, 9:19 am)
Re: I'm a total push-over.., Andreas Ericsson, (Thu Jan 24, 12:00 pm)
Re: I'm a total push-over.., Marko Kreen, (Fri Jan 25, 4:08 pm)
Re: I'm a total push-over.., Dmitry Potapov, (Thu Jan 24, 12:28 pm)
Re: I'm a total push-over.., Linus Torvalds, (Thu Jan 24, 1:15 pm)
Re: I'm a total push-over.., Marko Kreen, (Fri Jan 25, 4:52 pm)
Re: I'm a total push-over.., Linus Torvalds, (Fri Jan 25, 6:16 pm)
Re: I'm a total push-over.., Marko Kreen, (Sat Jan 26, 8:37 am)
Re: I'm a total push-over.., Marko Kreen, (Sat Jan 26, 8:16 am)
Re: I'm a total push-over.., Linus Torvalds, (Sun Jan 27, 2:51 am)
Re: I'm a total push-over.., Marko Kreen, (Sun Jan 27, 5:45 am)
Re: I'm a total push-over.., Dmitry Potapov, (Sun Jan 27, 11:06 am)
Re: I'm a total push-over.., Dmitry Potapov, (Sun Jan 27, 4:21 am)
Re: I'm a total push-over.., Johannes Schindelin, (Sun Jan 27, 10:07 am)
Re: I'm a total push-over.., Dmitry Potapov, (Sun Jan 27, 10:48 am)
Re: I'm a total push-over.., Linus Torvalds, (Fri Jan 25, 6:35 pm)
Re: I'm a total push-over.., Dmitry Potapov, (Thu Jan 24, 2:45 pm)
Re: I'm a total push-over.., Linus Torvalds, (Thu Jan 24, 3:08 pm)
Re: I'm a total push-over.., Marko Kreen, (Thu Jan 24, 12:13 pm)
Re: I'm a total push-over.., Luke Lu, (Thu Jan 24, 2:51 am)
Re: I'm a total push-over.., Andreas Ericsson, (Thu Jan 24, 6:24 am)
Re: I'm a total push-over.., Junio C Hamano, (Tue Jan 22, 10:23 pm)
Re: I'm a total push-over.., Linus Torvalds, (Tue Jan 22, 10:58 pm)
Re: I'm a total push-over.., Junio C Hamano, (Wed Jan 23, 3:23 am)
Re: I'm a total push-over.., Johannes Schindelin, (Wed Jan 23, 8:25 am)
Re: I'm a total push-over.., Linus Torvalds, (Wed Jan 23, 12:25 pm)
Re: I'm a total push-over.., Johannes Schindelin, (Wed Jan 23, 12:34 pm)
Re: I'm a total push-over.., Linus Torvalds, (Wed Jan 23, 1:09 pm)
Re: I'm a total push-over.., Linus Torvalds, (Wed Jan 23, 1:29 pm)
Re: I'm a total push-over.., Jeremy Maitin-Shepard, (Fri Jan 25, 1:21 am)
Re: I'm a total push-over.., Johannes Schindelin, (Fri Jan 25, 8:51 am)
Re: I'm a total push-over.., Jeremy Maitin-Shepard, (Fri Jan 25, 2:19 pm)
Re: I'm a total push-over.., Junio C Hamano, (Fri Jan 25, 3:07 pm)
Re: I'm a total push-over.., Johannes Schindelin, (Fri Jan 25, 2:24 pm)
Re: I'm a total push-over.., Linus Torvalds, (Tue Jan 22, 11:19 pm)
Re: I'm a total push-over.., Junio C Hamano, (Fri Jan 25, 2:50 am)
Re: I'm a total push-over.., Linus Torvalds, (Fri Jan 25, 12:24 pm)
Re: I'm a total push-over.., Junio C Hamano, (Tue Jan 22, 10:36 pm)
Re: I'm a total push-over.., Johannes Schindelin, (Wed Jan 23, 8:24 am)
Re: I'm a total push-over.., David Kastrup, (Wed Jan 23, 8:28 am)
Re: I'm a total push-over.., Theodore Tso, (Wed Jan 23, 8:56 am)
Re: I'm a total push-over.., Kevin Ballard, (Tue Jan 22, 9:35 pm)
speck-geostationary