Live data from Hacker News

Golang – encoding/csv: Reading is slow

github.com

1–10 of 102 posts

Re: Golang – encoding/csv: Reading is slow

#4

Python's csv module uses an internal module _csv which is written in C. So I'm not sure it's all that surprising that a Go implementation is a bit slower.

How about Java? It is quite funny Java version is much faster than Python version even when Python version does use C ? Something fishy going on.

Re: Golang – encoding/csv: Reading is slow

#5

Python's csv module uses an internal module _csv which is written in C. So I'm not sure it's all that surprising that a Go implementation is a bit slower.

I don't think the answer is that simple. Perhaps there's a key optimization that the Go team didn't consider.

Re: Golang – encoding/csv: Reading is slow

#6
post #3

Python's csv module uses an internal module _csv which is written in C. So I'm not sure it's all that surprising that a Go implementation is a bit slower.

You should contribute this knowledge to the GitHub issue.

A good idea, but I think it's common knowledge.

Lots of modules in the stdlib are written in C.

Re: Golang – encoding/csv: Reading is slow

#7
post #3

Python's csv module uses an internal module _csv which is written in C. So I'm not sure it's all that surprising that a Go implementation is a bit slower.

You should contribute this knowledge to the GitHub issue.

ultimately it's of academic interest - the end user doesn't care what precisely is going on under the hood.

Re: Golang – encoding/csv: Reading is slow

#8
post #4

Python's csv module uses an internal module _csv which is written in C. So I'm not sure it's all that surprising that a Go implementation is a bit slower.

How about Java? It is quite funny Java version is much faster than Python version even when Python version does use C ? Something fishy going on.

The java one doesn't do as much as the python one: `line.split(',')` doesn't handle quoted commas, escape characters, different csv separators, etc.

Re: Golang – encoding/csv: Reading is slow

#9
post #4

Python's csv module uses an internal module _csv which is written in C. So I'm not sure it's all that surprising that a Go implementation is a bit slower.

How about Java? It is quite funny Java version is much faster than Python version even when Python version does use C ? Something fishy going on.

Yeah, calling from python introduces a layer of inefficiency.

Re: Golang – encoding/csv: Reading is slow

#10
post #4

Python's csv module uses an internal module _csv which is written in C. So I'm not sure it's all that surprising that a Go implementation is a bit slower.

How about Java? It is quite funny Java version is much faster than Python version even when Python version does use C ? Something fishy going on.

It's as if there's more to software quality than the choice of tools.
Post reply on HN