Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • harvard1
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Gradvis typat Python med Cython.
KTH, School of Computer Science and Communication (CSC).
KTH, School of Computer Science and Communication (CSC).
2011 (Swedish)Independent thesis Advanced level (professional degree), 10 credits / 15 HE creditsStudent thesis
Abstract [en]

In this report Cython, an experimental programming language which adds functionality to Python was studied. One of the functionalities added by Cython is optional static type annotations. How these optional static type declarations affect performance is the main focus of this report. The effect of these type annotations on type safety and software design aspects of Python was also studied, but to a lesser extent.

To establish how static type annotations affect performance three test cases were designed. These test cases were then gradually typed in a number of versions with different amounts of static typing. Finally, the execution times of the different versions were measured.

It was found that gradual typing using Cython is a excellent optimization strategy for some Python code, particularly numeric calculations. However, Cythons gradually typed type system can not fully be considered an alternative to popular staticly typed languages with respect to software design considerations.

Abstract [sv]

I denna rapport undersöks Cython, ett experimentellt programmeringsspråk vilket tillför viss funktionalitet till Python, bland annat valfria statiska typannotationer. Huvudfrågan i denna rapport är vilken prestandapåverkan denna statiska typinformation har, men även dess effekter på typsäkerhet och mjukvarukonstruktionsaspekter i Python berörs i korthet.

För att utröna på vilket sätt typannotationerna påverkar prestanda utformades tre testfall. Testfallen typades till ett antal versioner med olika grad av statisk typning, varpå exekveringstiden mättes.

Gradvis typning med Cython visade sig vara ett utmärkt sätt att optimera vissa Pythonkod, särskilt numeriska beräkningar. Cythons valfritt statiska typsystem är dock inte ett fullgott alternativ till helt statiskt typade språk ur ett mjukvarukonstruktionsperspektiv.

Place, publisher, year, edition, pages
2011.
Series
Kandidatexjobb CSC, K11001
National Category
Computer Science
Identifiers
URN: urn:nbn:se:kth:diva-130823OAI: oai:DiVA.org:kth-130823DiVA: diva2:654270
Educational program
Master of Science in Engineering - Computer Science and Technology
Uppsok
Technology
Supervisors
Examiners
Available from: 2013-10-07 Created: 2013-10-07

Open Access in DiVA

No full text

Other links

http://www.csc.kth.se/utbildning/kandidatexjobb/datateknik/2011/rapport/gustafsson_fredrik_OCH_holmberg_viktor_K11001.pdf
By organisation
School of Computer Science and Communication (CSC)
Computer Science

Search outside of DiVA

GoogleGoogle Scholar

urn-nbn

Altmetric score

urn-nbn
Total: 33 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • harvard1
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf