Python vs Java performance