So I can't write for example on Scala (which I read is pretty cool language). So first I started is googled "java suck" and found couple interesting texts, most interesting: http://www.slideshare.net/jeffz/why-java-sucks-and-c-rocks-final. Just real facts why java suck vs C# rocks - read it.
Next I wrote code, that go thought large (140mb) csv file and represent information in internal HashMap structure and then serialize it to file. When I run it I got to swap, so I stopped execution.
So now it's only 1/5 of file (~30mb) and I wrote Python code just to compare:
Java | Python | |
Lines of code | 76 | 38 |
IMHO code looks | ugly | not so bad |
Memory usage | 23.3% | 31.4% |
Execution time (cpu) | 48 sec | 77 sec |
Output file | 140mb | 150mb |
In result, I can also note, that Java reads and makes structure very fast but take a long time to serialize and write to file. And Python contrary.
Still work on this stuff. Wish me good luck :)
No comments:
Post a Comment