58
edits
Changes
→Reference
{{GPU621/DPS921 Index | 20207}}
[mailto:astinziani@myseneca.ca?subject=GPU621 Yuseok Won]
[mailto:astinziani@myseneca.ca?subject=GPU621 Minsu Kim]
Concurrency allows to execute multiple tasks in partial order or out of order. The executions must finished before the next execution can start. While, parallelism has simultaneous execution on a multicore per CPU.
If we combine two concepts:
| style="padding: 15px;" |
{| class="wikitable" margin-left: left;
|+ Performance difference for Go Thread
|-
! !! difference
|-
| Main Thread to 1 thread|| 0.45%
|-
| 1 thread to 2 threads|| 127.30%
|-
| 2 threads to 4 threads|| 93.12%
|-
| 4 threads to 8 threads|| 68.27%
|-
| 8 threads to 16 threads|| -20.65%
|}
|style="padding: 15px;"|
{| class="wikitable"
|+ Performance increase of Go in comparsion to Java Thread
|-
! !! difference
|-
| Main thread|| 102%
|-
| 1 thread|| 101%
|-
| 2 thread|| 96.90%
|-
| 4 thread|| 81.80%
|-
| 8 thread|| 55%
|-
| 16 thread|| 12%
|}
|}
==Analysis==
The results of matrix multiplication implementation on Go language has remarkable superiority in main thread. However, the both language shows the tendency that execution time gradually decreases as the number of threads increase. The curve of execution time on the graph become flatten for both Go and Java when the number of threads become 8 and 16. We infer the Go has a reduction tendency when the number of threads reach 8 and 16 but Java shows the promotion tendency as number of threads reach 8 and 16. The best performance has been shown that the 8 threads for Go and 16 threads on Java. The percentage difference of implementation time between GO and Java shows minimum 12% when 16 threads being used and maximum 102% when main thread being used.
There is a few possible reason that Go and Java shows difference performance despite using same calculating matrix multiplication algorithm. First, the code for Go and Java is not exactly matched. second, Java uses JVM(Java Virtual Machine) to calculate the algorithm which may take more time to implement.
=Reference== What's Javahttps://golang.org/doc/faq#goroutines <br>https://docs.oracle.com/javase/tutorial/essential/concurrency/highlevel.html<br>http://www.oracle.com/technetwork/java/javase/overview/javahistory-index-198355.html<br>https://golang.org/doc/faq#Origins<br>https://www.youtube.com/watch? v===oV9rvDllKEg<br>https://stackoverflow.com/questions/1050222/what-is-the-difference-between-concurrency-and-parallelism<br>https://onlinenumbertools.com/random-number-matrix<br>https://golang.org/dl/<br>https://www.java.com/ko/download/manual.jsp<br>https://docs.oracle.com/javase/tutorial/essential/concurrency/executors.html