I have an application I wrote in PHP (on symfony) that imports large CSV files (up to 100,000 lines). It has a real memory usage problem. Once it gets through about 15,000 rows, it grinds to a halt.
I know there are measures I could take within PHP but I’m kind of done with PHP, anyway.
If I wanted to write an app that imports CSV files, do you think there would be any significant difference between Ruby and Python? Is either one of them geared to more import-related tasks? I realize I’m asking a question based on very little information. Feel free to ask me to clarify things, or just speak really generally.
If it makes any difference, I really like Lisp and I would prefer the Lispier of the two languages, if possible.
What are you importing the CSV file into? Couldn’t you parse the CSV file in a way that doesn’t load the whole thing into memory at once (i.e. work with one line at a time)?
If so, then you can use Python’s standard
csvlibrary to do something like the followingNow don’t take this answer as an immediate reason to switch to Python. I’d be very surprised if PHP didn’t have a similar functionality in its CSV library, etc.