mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
Updated Improving performance with Viper code (markdown)
@@ -70,7 +70,7 @@ These data types are very fast. They are not implemented as an MicroPython objec
|
||||
|
||||
Most of the difficulties using the Viper code emitter are related to the use of these data types and their peculiarities. So here goes a lot of detail about these data types.
|
||||
|
||||
Viper variables are "raw" variables and are not stored as MicroPython objects. In contrast the string, tuple, list and integer variables we all know are always stored ad MicroPython objects.
|
||||
Viper variables are "raw" variables and are not stored as MicroPython objects. In contrast the string, tuple, list and integer variables we all know are always stored as MicroPython objects.
|
||||
|
||||
The Viper code emitter detects Viper variables at compile time, and generates very fast code for the operations. For example
|
||||
```x = 0``` or ```x = int(myfunction())``` will make `x` Viper `int` variable. Now, `x = x + 1` will be compiled around 2 or 3 machine code instructions!
|
||||
|
||||
Reference in New Issue
Block a user