Talk:Null character

message: I would really like to see a source for this:
:"Null-terminated strings can also have efficiency benefits, since operations that traverse a string don't need to keep track of how many characters have been seen, and operations which modify the string's length do not need to update the stored length. Cache performance can also be better."
So have added citation needed. For one, on most architectures both a "subtract and jump if not zero" is identical to a "compare and jump if not zero". Yet by having the length first loops can be unrolled for far greater speed - something that is very difficult to do with a null terminator. For example, many languages that have known lengths are able to use sse2 and move 16 bytes at a time from a string - the same procedure to move a C style string performs atrociously in comparison. Themania (talk) 14:17, 28 January 2008 (UTC)
replies: text: The only operation that is faster is "give me the tail of this string". This is indeed O(1) for nul-terminated strings, while O(N) at least for all other usable representations of strings (a large object containing both an original pointer+length plus a current pointer+length would also be O(1) but has impractical overhead for other purposes). It is also true that software has taken advantage of this, which is one of the main reasons it is difficult to transition away from nul-terminated strings and why it often gets much slower. Typical example is passing a pointer to the middle of a string and assuming that is free.Spitzak (talk) 18:24, 22 September 2009 (UTC)

text: The original reason for nul termination is that with an overhead of one byte, you get unlimited string length. The alternative considered when this was done was a 1-byte length, which gave you a limit of 255 bytes. This length limit was much worse than the problems with not allowing one character value. Overhead of more than one byte was not even considered then, you would have been nuts to suggest it. This was when 4K was a typical memory size.Spitzak (talk) 18:24, 22 September 2009 (UTC)

text: SSE: Modern processors manipulate nul-terminated strings in units far larger than one byte in typical strcpy implementations. This is because you can do tests that will reveal if one of the bytes in the larger unit is nul and then do that last unit with byte-based code. So the SSE advantages are far less than you think. One disadvantage of nul-terminated strings is that they are often not page-aligned at the start, requiring special code at both the start and end of the string.Spitzak (talk) 04:29, 15 April 2010 (UTC)
thread_title: Efficiency

message: I'm no good at computer. 71.84.126.174 (talk) 08:51, 1 October 2010 (UTC)
thread_title: ow, my brain!

message: I disagree with the phrase "with the value of zero" since zero has its own unique ASCII character; the phrase "with the value of zero" is misleading. The null character is non-numeric. I invite further discussion on the difference between zero and null since they are not the same philosophically, neither are the same within a numerical ordering. This concept was taught in the computer engineering curriculum at the University of Miami in Coral Gables, FL during my studies there. - MPO, mattjava77@gmail.com  — Preceding unsigned comment added by 107.41.63.164 (talk) 03:05, 28 December 2013 (UTC)
thread_title:  Definition of "null character" is NOT zero 

message: Hello fellow Wikipedians,
I have just modified one external link on Null character. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
*Added archive https://web.archive.org/web/20140512221203/http://kikaku.itscj.ipsj.or.jp/ISO-IR/001.pdf to http://kikaku.itscj.ipsj.or.jp/ISO-IR/001.pdf
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
Cheers.—InternetArchiveBot (Report bug) 05:07, 10 December 2017 (UTC)
thread_title:  External links modified