3 ms·
1. there's nothing useless about it 2. the Python 3 CSV library supports arbitrary codepoints as delimiter, quote character and escape character (if applicable
by masklinn 10y ago
1. there's nothing useless about it
2. the Python 3 CSV library supports arbitrary codepoints as delimiter, quote character and escape character (if applicable)
- geofft 10y ago> 1. there's nothing useless about it Have you ever seen a "C"SV with a multibyte sequence as a delimiter? I haven't. Even if such a thing exists, the feature is of negative utility if it slows down CSV parsing for everyone else. If you must, write two implementations, and use the slow path if your delimiter is multibyte.
- drej 10y agoThat's precisely my suggestion https://github.com/golang/go/issues/16791#issuecomment-242092274 https://github.com/golang/go/issues/16791#issuecomment-24209... Moving from runes to bytes in reading gives us a nice speedup - not quite to eliminate the gap, but it's a start. The rest is likely all the memory copies - once the data is read in a buffer, then copied byte by byte into a slice and only then converted into a string, which is another copy, because strings can't be based on pre-existing byte slices (not in the public API that is).
- coldtea 10y ago>1. there's nothing useless about it Opportunity cost. It slows down the parsing for support of something that nobody has ever seen in the wild (not to mention it doesn't even match the name of the format, but let's get past that since we already use ; | and others). Plus I can't even imagine a use case that would make it a good idea to use that over a simpler delimiter, or even the special purpose ASCII delimiter character. Can you?