What python can learn from java

3,198 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,198
On SlideShare
0
From Embeds
0
Number of Embeds
36
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

What python can learn from java

  1. 1. What Python can learn from Java jbellis@datastax.comSaturday, September 10, 2011
  2. 2. Saturday, September 10, 2011
  3. 3. (Not a web development perspective)Saturday, September 10, 2011
  4. 4. Lesson one: GC ✤ Hotspot GC ✤ Pluggable ✤ Well-documented (http://java.sun.com/j2se/reference/ whitepapers/memorymanagement_whitepaper.pdf) ✤ Tuneable (http://www.slideshare.net/ludomp/gc-tuning-in-the- hotspot-java-vm-a-fisl-10-presentation)Saturday, September 10, 2011
  5. 5. Troubleshooting OOMSaturday, September 10, 2011
  6. 6. Troubleshooting fragmentation http://www.cloudera.com/blog/2011/02/avoiding-full-gcs-in-hbase-with-memstore-local-allocation-buffers-part-2/Saturday, September 10, 2011
  7. 7. Lesson 2: Concurrency ✤ For CPU-bound applications, copies are the enemy ✤ Corollary: you need to support threads + shared state ✤ Actor model ✤ Multi-process + sysvSaturday, September 10, 2011
  8. 8. java.util.concurrent: ahead of its time ✤ ConcurrentSkipListMap ✤ CopyOnWriteArrayList ✤ NonblockingHashMap* ✤ Atomic[Int|Long|Reference|...] ✤ SynchronousQueue ✤ Java 7: TransferQueue ✤ ThreadPoolExecutor, ScheduledThreadPoolExecutor ✤ FutureTaskSaturday, September 10, 2011
  9. 9. Shared state = good, Mutable state = bad ✤ guava: Immutable collections ✤ http://code.google.com/p/guava-libraries/ ✤ Persistent collections ✤ http://code.google.com/p/pcollections/ ✤ (More accurately, “What Python can learn from Haskell”)Saturday, September 10, 2011

×