Guest User

Untitled

a guest
Aug 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. ##FillLinkedListWithInteger.java
  2. import java.util.*;
  3.  
  4. public class FillLinkedListWithInteger {
  5.  
  6. public static void main(String...args) {
  7.  
  8. List<Integer> list = new LinkedList<Integer>();
  9.  
  10. long start = System.currentTimeMillis();
  11.  
  12. for(Integer i = 0; i < 1000000; i++) {
  13. list.add(i);
  14. }
  15.  
  16.  
  17. long end = System.currentTimeMillis();
  18.  
  19. System.out.println("Milliseconds: " + (end - start));
  20.  
  21.  
  22. }
  23.  
  24. }
  25.  
  26. ##java -Xprof -Xint FillLinkedListWithInteger
  27. Milliseconds: 1624
  28.  
  29. Flat profile of 1.63 secs (87 total ticks): main
  30.  
  31. Interpreted + native Method
  32. 33.3% 29 + 0 java.util.LinkedList.addBefore
  33. 26.4% 23 + 0 FillLinkedListWithInteger.main
  34. 10.3% 9 + 0 java.lang.Integer.valueOf
  35. 8.0% 7 + 0 java.lang.Integer.<init>
  36. 8.0% 7 + 0 java.util.LinkedList$Entry.<init>
  37. 6.9% 6 + 0 java.util.LinkedList.add
  38. 3.4% 3 + 0 java.lang.Number.<init>
  39. 2.3% 2 + 0 java.lang.Object.<init>
  40. 1.1% 1 + 0 java.lang.Integer.intValue
  41. 100.0% 87 + 0 Total interpreted
  42.  
  43.  
  44. Flat profile of 0.01 secs (1 total ticks): DestroyJavaVM
  45.  
  46. Thread-local ticks:
  47. 100.0% 1 Blocked (of total)
  48.  
  49.  
  50. Global summary of 1.64 seconds:
  51. 100.0% 113 Received ticks
  52. 22.1% 25 Received GC ticks
  53.  
  54. ##FillLinkedListWithInt.java
  55. import java.util.*;
  56.  
  57. public class FillLinkedListWithInt {
  58.  
  59. public static void main(String...args) {
  60.  
  61. List<Integer> list = new LinkedList<Integer>();
  62.  
  63. long start = System.currentTimeMillis();
  64.  
  65. for(int i = 0; i < 1000000; i++) {
  66. list.add(i);
  67. }
  68.  
  69.  
  70. long end = System.currentTimeMillis();
  71.  
  72. System.out.println("Milliseconds: " + (end - start));
  73.  
  74.  
  75. }
  76.  
  77. }
  78.  
  79. ##java -Xprof -Xint FillLinkedListWithInt
  80. Milliseconds: 1410
  81.  
  82. Flat profile of 1.42 secs (74 total ticks): main
  83.  
  84. Interpreted + native Method
  85. 59.5% 44 + 0 java.util.LinkedList.addBefore
  86. 8.1% 6 + 0 java.lang.Number.<init>
  87. 6.8% 5 + 0 java.util.LinkedList.add
  88. 6.8% 5 + 0 java.util.LinkedList$Entry.<init>
  89. 6.8% 5 + 0 FillLinkedListWithInt.main
  90. 5.4% 4 + 0 java.lang.Object.<init>
  91. 4.1% 3 + 0 java.lang.Integer.<init>
  92. 2.7% 2 + 0 java.lang.Integer.valueOf
  93. 100.0% 74 + 0 Total interpreted
  94.  
  95.  
  96. Flat profile of 0.01 secs (1 total ticks): DestroyJavaVM
  97.  
  98. Thread-local ticks:
  99. 100.0% 1 Blocked (of total)
  100.  
  101.  
  102. Global summary of 1.43 seconds:
  103. 100.0% 99 Received ticks
  104. 24.2% 24 Received GC ticks
Add Comment
Please, Sign In to add comment