Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

What python can learn from java

3,284 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

  • Be the first to like this

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

×