Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##FillLinkedListWithInteger.java
- import java.util.*;
- public class FillLinkedListWithInteger {
- public static void main(String...args) {
- List<Integer> list = new LinkedList<Integer>();
- long start = System.currentTimeMillis();
- for(Integer i = 0; i < 1000000; i++) {
- list.add(i);
- }
- long end = System.currentTimeMillis();
- System.out.println("Milliseconds: " + (end - start));
- }
- }
- ##java -Xprof -Xint FillLinkedListWithInteger
- Milliseconds: 1624
- Flat profile of 1.63 secs (87 total ticks): main
- Interpreted + native Method
- 33.3% 29 + 0 java.util.LinkedList.addBefore
- 26.4% 23 + 0 FillLinkedListWithInteger.main
- 10.3% 9 + 0 java.lang.Integer.valueOf
- 8.0% 7 + 0 java.lang.Integer.<init>
- 8.0% 7 + 0 java.util.LinkedList$Entry.<init>
- 6.9% 6 + 0 java.util.LinkedList.add
- 3.4% 3 + 0 java.lang.Number.<init>
- 2.3% 2 + 0 java.lang.Object.<init>
- 1.1% 1 + 0 java.lang.Integer.intValue
- 100.0% 87 + 0 Total interpreted
- Flat profile of 0.01 secs (1 total ticks): DestroyJavaVM
- Thread-local ticks:
- 100.0% 1 Blocked (of total)
- Global summary of 1.64 seconds:
- 100.0% 113 Received ticks
- 22.1% 25 Received GC ticks
- ##FillLinkedListWithInt.java
- import java.util.*;
- public class FillLinkedListWithInt {
- public static void main(String...args) {
- List<Integer> list = new LinkedList<Integer>();
- long start = System.currentTimeMillis();
- for(int i = 0; i < 1000000; i++) {
- list.add(i);
- }
- long end = System.currentTimeMillis();
- System.out.println("Milliseconds: " + (end - start));
- }
- }
- ##java -Xprof -Xint FillLinkedListWithInt
- Milliseconds: 1410
- Flat profile of 1.42 secs (74 total ticks): main
- Interpreted + native Method
- 59.5% 44 + 0 java.util.LinkedList.addBefore
- 8.1% 6 + 0 java.lang.Number.<init>
- 6.8% 5 + 0 java.util.LinkedList.add
- 6.8% 5 + 0 java.util.LinkedList$Entry.<init>
- 6.8% 5 + 0 FillLinkedListWithInt.main
- 5.4% 4 + 0 java.lang.Object.<init>
- 4.1% 3 + 0 java.lang.Integer.<init>
- 2.7% 2 + 0 java.lang.Integer.valueOf
- 100.0% 74 + 0 Total interpreted
- Flat profile of 0.01 secs (1 total ticks): DestroyJavaVM
- Thread-local ticks:
- 100.0% 1 Blocked (of total)
- Global summary of 1.43 seconds:
- 100.0% 99 Received ticks
- 24.2% 24 Received GC ticks
Add Comment
Please, Sign In to add comment