Skip to content

ESP32: use single precision floats for performance reasons#1082

Closed
bettio wants to merge 1 commit intoatomvm:mainfrom
bettio:esp32-use-float
Closed

ESP32: use single precision floats for performance reasons#1082
bettio wants to merge 1 commit intoatomvm:mainfrom
bettio:esp32-use-float

Conversation

@bettio
Copy link
Copy Markdown
Collaborator

@bettio bettio commented Feb 29, 2024

Documentation says: "Avoid using double precision floating point arithmetic double. These calculations are emulated in software and are very slow. If possible then use an integer-based representation, or single-precision floating point."

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Documentation says: "Avoid using double precision floating point
arithmetic double. These calculations are emulated in software and are
very slow. If possible then use an integer-based representation, or
single-precision floating point."

Signed-off-by: Davide Bettio <davide@uninstall.it>
Copy link
Copy Markdown
Collaborator

@UncleGrumpy UncleGrumpy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I have been wanting to see this change for a while.

@UncleGrumpy
Copy link
Copy Markdown
Collaborator

I did some testing, and as you mentioned in the Telegram group, this makes little difference in performance. Either Espressifs documentation is misleading, or there is something else preventing the hardware FPU from being used.

@bettio bettio closed this Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants