CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/CPUInfo/output.txt
Views: 1798
1
Type sizes:
2
char : 1
3
short : 2
4
int : 2
5
long : 4
6
long long : 8
7
bool : 1
8
void* : 2
9
10
Operation timings:
11
Note: timings for some operations are very data dependent
12
nop 0.07 usec/call
13
cli/sei 0.14 usec/call
14
micros() 3.17 usec/call
15
millis() 1.47 usec/call
16
fadd 9.18 usec/call
17
fsub 9.25 usec/call
18
fmul 7.96 usec/call
19
fdiv 7.96 usec/call
20
dadd 9.18 usec/call
21
dsub 9.25 usec/call
22
dmul 6.14 usec/call
23
ddiv 6.07 usec/call
24
sin() 112.35 usec/call
25
cos() 113.11 usec/call
26
tan() 154.92 usec/call
27
acos() 167.69 usec/call
28
asin() 82.16 usec/call
29
atan2() 193.34 usec/call
30
sqrt() 31.67 usec/call
31
iadd8 0.48 usec/call
32
isub8 0.48 usec/call
33
imul8 0.67 usec/call
34
idiv8 5.57 usec/call
35
iadd16 0.92 usec/call
36
isub16 0.92 usec/call
37
imul16 1.42 usec/call
38
idiv16 13.31 usec/call
39
iadd32 1.80 usec/call
40
isub32 1.80 usec/call
41
imul32 4.69 usec/call
42
idiv32 37.89 usec/call
43
iadd64 7.96 usec/call
44
isub64 8.53 usec/call
45
imul64 45.82 usec/call
46
idiv64 230.95 usec/call
47
memcpy128 56.76 usec/call
48
memset128 49.84 usec/call
49
delay(1) 1007.65 usec/call
50
51
52
53
Additional notes:
54
55
eeprom_read_byte: 2 usec/call
56
eeprom_write_byte: first call costs 5 usec, each subsequent byte
57
costs 3480 usec as it waits for the EEPROM to be
58
ready from the previous byte
59
60
pgm_read_byte: 0.5 usec per byte
61
62
dataflash write:
63
50 usec per byte, same on APM1 and APM2
64
if we change API to do block writes, will be 8 usec per byte
65
66
67