What python can learn from java

Post on 01-Nov-2014

2,888 views 1 download

description

 

transcript

What Python can learn from Javajbellis@datastax.com

Saturday, September 10, 2011

Saturday, September 10, 2011

(Not a web development perspective)

Saturday, September 10, 2011

Troubleshooting OOM

Saturday, September 10, 2011

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

Lesson 2: Concurrency

✤ For CPU-bound applications, copies are the enemy✤ Corollary: you need to support threads + shared state

✤ Actor model✤ Multi-process + sysv

Saturday, September 10, 2011

java.util.concurrent: ahead of its time

✤ ConcurrentSkipListMap✤ CopyOnWriteArrayList✤ NonblockingHashMap*✤ Atomic[Int|Long|Reference|...]✤ SynchronousQueue ✤ Java 7: TransferQueue✤ ThreadPoolExecutor, ScheduledThreadPoolExecutor

✤ FutureTask

Saturday, September 10, 2011

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