Profile

Cover photo
Dimitris Leventeas
Worked at Eidgenössische Technische Hochschule Zürich
Attended University Of Patras
Lives in Zurich
262 followers|27,174 views
AboutPostsPhotos

Stream

Dimitris Leventeas

Shared publicly  - 
 
 
Some patterns for fast Python. Know any others?

- Avoid overengineering datastructures. Tuples are better than objects (try namedtuple too though). Prefer simple fields over getter/setter functions.

- Built-in datatypes are your friends. Use more numbers, strings, tuples, lists, sets, dicts. Also check out the collections library, esp. deque.

- Be suspicious of function/method calls; creating a stack frame is expensive.

- Don't write Java (or C++, or Javascript, ...) in Python.

- Are you sure it's too slow? Profile before optimizing!

- The universal speed-up is rewriting small bits of code in C. Do this only when all else fails.
1
Michael Thang's profile photo
 
Hi.Marry Christmas my dear friend.How do you do there today my dear friend.Are you OK.
Add a comment...

Dimitris Leventeas

Shared publicly  - 
 
Jeremy Cowart originally shared:
 
I have no idea who created this image. But good grief, it's powerful.
2
1
Add a comment...

Dimitris Leventeas

Shared publicly  - 
2
Dimitris Leventeas's profile photo
3 comments
 
hahahahaha!
 ·  Translate
Add a comment...
People
Have him in circles
262 people
Ioanna Kontotasiou's profile photo
Apostolis Mastoris's profile photo
Apostolos Filippas's profile photo
Panagiotis Vagenas's profile photo
Petros Vassiliou's profile photo
Stavros Nikolaou's profile photo
Calypso Kiriacopoulou's profile photo
Apostolis Bessas's profile photo
Work
Occupation
Computer Engineer
Employment
  • Eidgenössische Technische Hochschule Zürich
    Student
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Zurich
Previously
kalamata - patras - florina - komotini - lamia
Story
Tagline
I have discovered a truly marvelous demonstration of this proposition that this margin is too narrow to contain.
Introduction
Under development. Currently @ETH
Bragging rights
https://bitbucket.org/myle , http://python.org.gr
Education
  • University Of Patras
    Computer Engineering & Informatics Department, 2005 - 2010
Basic Information
Gender
Male