what python can learn from java
DESCRIPTION
TRANSCRIPT
![Page 2: What python can learn from java](https://reader033.vdocuments.site/reader033/viewer/2022051411/5458262aaf7959755d8b5137/html5/thumbnails/2.jpg)
Saturday, September 10, 2011
![Page 3: What python can learn from java](https://reader033.vdocuments.site/reader033/viewer/2022051411/5458262aaf7959755d8b5137/html5/thumbnails/3.jpg)
(Not a web development perspective)
Saturday, September 10, 2011
![Page 4: What python can learn from java](https://reader033.vdocuments.site/reader033/viewer/2022051411/5458262aaf7959755d8b5137/html5/thumbnails/4.jpg)
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
![Page 5: What python can learn from java](https://reader033.vdocuments.site/reader033/viewer/2022051411/5458262aaf7959755d8b5137/html5/thumbnails/5.jpg)
Troubleshooting OOM
Saturday, September 10, 2011
![Page 6: What python can learn from java](https://reader033.vdocuments.site/reader033/viewer/2022051411/5458262aaf7959755d8b5137/html5/thumbnails/6.jpg)
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
![Page 7: What python can learn from java](https://reader033.vdocuments.site/reader033/viewer/2022051411/5458262aaf7959755d8b5137/html5/thumbnails/7.jpg)
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
![Page 8: What python can learn from java](https://reader033.vdocuments.site/reader033/viewer/2022051411/5458262aaf7959755d8b5137/html5/thumbnails/8.jpg)
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
![Page 9: What python can learn from java](https://reader033.vdocuments.site/reader033/viewer/2022051411/5458262aaf7959755d8b5137/html5/thumbnails/9.jpg)
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