Optimising Python speed tutorial
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Optimising Python speed tutorial
For those who don't follow Github I've written a tutorial planned for eventual inclusion in the official docs. At this stage it's very much a draft and is doubtless littered with typos. Comments on the content are invited, especially if there are factual errors or useful techniques I've omitted. It can be read here: http://hinch.me.uk/html/reference/speed_python.html
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Optimising Python speed tutorial
Great article, thanks!
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)
HAM radio call: HA5DI (Béla)
Re: Optimising Python speed tutorial
Excellent.
The second to the last sentence in the Garbage Collection section doesn't make sense (well really just the bcomes at the end):
The second to the last sentence in the Garbage Collection section doesn't make sense (well really just the bcomes at the end):
Finally performing collections regularly can reduce fragmentation in the heap bcomes.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Optimising Python speed tutorial
Thanks, Dave. Now fixed.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Optimising Python speed tutorial
Hello @pythoncoder, that is really a good text, and it is a big support for everyone trying to code "at the bus". And I am definitely the wrong person for see typos. Maybe Damien or someone else from the core team could have a look at it, if something would have to be amended, especially about language extensions of the viper emitter.
Re: Optimising Python speed tutorial
A really useful and competent writeup. Thanks a lot for sharing.
Re: Optimising Python speed tutorial
Well, I can only second this. I have really missed this kind of good documentation.
So I feel a little uneasy to mention one small correction: Time is measured in seconds and the SI-unit is spelled with lower case "s". (The upper case "S" is used for Siemens [= 1/ohm]). So in the Python code examples, that are so good and welcome, it is a little disturbing to see the unit for time as "mS". For me this looks like "milli Siemens".
I have for a long time hesitated to mention this small thing, but since I'm sure a lot of people will enjoy pythoncoder's documentation and Python scripts, I decided to suggest this minute correction after all.
So I feel a little uneasy to mention one small correction: Time is measured in seconds and the SI-unit is spelled with lower case "s". (The upper case "S" is used for Siemens [= 1/ohm]). So in the Python code examples, that are so good and welcome, it is a little disturbing to see the unit for time as "mS". For me this looks like "milli Siemens".
I have for a long time hesitated to mention this small thing, but since I'm sure a lot of people will enjoy pythoncoder's documentation and Python scripts, I decided to suggest this minute correction after all.
Re: Optimising Python speed tutorial
Great work, pythoncoder! And while this fits wll with "Development" subforum, I'm sure more wider exposure via "General" will only help, so moving it there.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/