Skip to content

Change Android float ABI to hard

Created by: RandomShaper

I've done the experiment of compiling the Android export templates with the hard float ABI instead of soft-fp. I've written a simple test script and measured:

Current soft-fp: 1781 +/- 48 ms Experimental hard: 1796 +/- 53 ms

Pretty surprising for me. I didn't expect a big gain because GDScript is a large bottle neck compared with the floating point calling convention; but a pessimization?

Maybe my test program is not the best one for this task or maybe this has yielded gains in other aspects (render, sound, etc.) and only a real-word example is appropiate for testing.

Or maybe this change just does not improve things at all and should not be merged. However, as long as Godot is built as a whole and the relevant functions are qualified with JNICALL it should be safe.

At least I've pushed it for the records in case some day this is considered again so both these notes and the relevant compiler flags, etc. could be grabbed from here.

P. S.: The test program is an empty scene with this code:

extends Node2D

func _ready():
    set_process(true)

func _process(delta):
    var start = OS.get_ticks_msec()
    for i in range(0, 1000000):
        i = float(i)
        cos(i) * sqrt(i) + exp(i) / i
    var end = OS.get_ticks_msec()
    print(end - start)

Merge request reports