Skip to content

sandzhang/WordSorter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Go/Java WordSorter Comparison

The Java code in this project was originally an assignment from the university. The goal was to write a Java program that accepted a list of words, and wrote them out in sorted order, using threads for speed. I used this project to see how Google's new language, Go, compared against Java with emphasis on LOC and performance. I'm glad to say that Go easily beats Java in both these cases. Go is also dramatically easier on system memory than Java.

Use

Go project can be run by entering the Go directory and issuing the following: go run main.go 128 sowpods.txt out.txt 128 is the number of goroutines, sowpods.txt is the input and out.txt is the output.

Java project can be run by entering Java directory and compile using javac Sort.java then run by issuing java Sort 128 sowpods.txt out.txt

Results

On my Macbook Air 13" mid-2012 the results where the following: Go: 732ms Java: 952ms

About

Go - Java comparison

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published