Your SlideShare is downloading. ×
  • Like
New Wind of Java
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

New Wind of Java

  • 242 views
Published

"New Wind of Java" …

"New Wind of Java"
富山合同勉強会 .NET & Java ~ぶりしゃぶで休もう~ 資料

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
242
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
1
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. New Wind of 9.‘ A I--‘K’-L‘ '. ‘ j {.5 L_, . _ ' " . ’_ . "" "_'; ‘tr ' ’ l ‘1 er . 9 v ’ . , , «,2 g , ;r_ V_ . _ ‘. ‘:. x. , __. ..~. . _: “_" “_~.
  • 2. Background Project Valhallais Project Pana I » a) ti‘; .' ‘ L ’ 1, . ' ' ' .1
  • 3. I Background E
  • 4. P t ,1 emo Light Speed
  • 5. Memory is the New Disk
  • 6. 1 Core 10 3 Register 1CLK 102KB L1 ~ 3CLK 103KB ~ 15cLK 104” SKB TM BUS ~ ZOOCLK
  • 7. Avoid a Cache Miss Locate Related Data Near
  • 8. Project Valhalla Value Type
  • 9. class Point { final int X; final int y; }
  • 10. Header Point[] pts = Header ' x Y * [ Header * x Y . ——{ Header x Y
  • 11. int[] x = Header
  • 12. Point[] pts = Header Value Type
  • 13. value class Point { final int X; final int y; } Value Type
  • 14. Primitive Type Value Type Complex Num Big Num Vector Tuple Reference Type
  • 15. value class OptionalInt { private final int t;
  • 16. _. ,4. «mad! 1 .1.” a x wfi ! .Ir. .
  • 17. class Box<T> { private final T t; public Box(T t) { this. t = t; } public T get() { return t; } }
  • 18. > javap -c -l Box class Box extends java. languObject{ private final java lang Object t; public Box(java lang Object); Code: public java lang Object get(); Code: 0: aload_0 1: getfield #2; / /Field t: Ljava/ lang/ Object; 4: areturn
  • 19. public class Test { public static void main(String. ., args) { Box<Integer> box = new Box<>(10); Integer number = box. get(); } } T I la fi % public class Test { public static void main(String. ., args) { Box box = new Box(Integer. value0f(10)); Integer number = (Integer)box. get(); } }
  • 20. Java Generics Type Erasure Method Type Parameter java. |ang. Object Primitive Type
  • 21. Prmitive Wrapper Class Integer, Double et al. Autoboxing Autounboxing Expensive Computation
  • 22. Specialization Box<int> box = new Box<>(10);
  • 23. class Box<T> { private final T t; public Box(T t) { } } this. t = t3 public T get() { } return t; class Box { } private final public Box( this. t = } public return t; } ti
  • 24. class Box{T= int} { private final int t; public Box(int t) { this. t = t; } public int get() { return t; } }
  • 25. public javaalang. Object*T get(); Code: 0: aload_@ 1: getfield #2; / /Field t: LObject*T; 4: areturn*T f lfif"mi I I l “ ‘mi public int get(); Code: 0: aload_@ 1: getfield #2; / /Field tzint; 4: ireturn
  • 26. Dark History lntStream lntFunction Optionallnt
  • 27. Issues Assumption of Ref. Type T[] array = (T[])new Object[n]; from ArrayList Ref. - Primitive Overloading List#remove(int index); List#remove(Object o); Null
  • 28. Project Panama ' Array 2.0 - ll {- 5‘ . u ‘ '*"~uu-'-cc -an I i ayout" ontol
  • 29. int[][] nums =
  • 30. int[][] nums = Header Array 2.0 1 2 5 6 Multi Dimension Index I} long Immutable
  • 31. When Calling Native Code,
  • 32. public interface @IgnoreError GetPid { long getPid(); ; GetPid getPid LibraryLoader ? getPid. getPid(); . create(GetPid. class) uload("c");
  • 33. JNR JNR-JFFI JFFI libffi Native Code
  • 34. JNR—UNIXSocket JNR—x86asm JNR—Constants JNR-JFFI JFFI l'ib'F‘F'i Native Code
  • 35. Conclusion Much Faster Less Memory by Project Valhalla Project Panama
  • 36. Java in the Box'' Yuichi Sakurabaf