This pr does not bring huge improvements to performance; in the case of bf_distance and bf_round they might even be slightly slower because of a call to Var::new_float.
Changes include:
Making doubles call Var::new_float to create the Var structure to return.
Removing foo.v.list[0].v.num from loop blocks, thus removing the requirement that instructions are generated to index into the list each iteration of the loop (mostly notable on larger lists).
Making various variables const. This will not provide much in the way of tangible performance increases in general, but is useful to insure that variables which should not be changed are not actually changing.
A full list of individual function-level changes is as follows:
Update bf_ftime to call Var::new_float; add Var::new_float.
update bf_sort: make various vars const, remove extra code and simply reverse the vector in place if reverse is true. This removes unneeded code around generating two iterators and using two loops based on whether or not reverse is true. This does mean that a small impact exists for reversing the sorted list, but this impact is minimal.
Update human_string for background threads to use nullptr and not 0; no bonus save for readability.
add various cleanups to Var structure (mostly making is_foo const methods).
This pr does not bring huge improvements to performance; in the case of
bf_distance
andbf_round
they might even be slightly slower because of a call toVar::new_float
. Changes include:Var::new_float
to create theVar
structure to return.foo.v.list[0].v.num
from loop blocks, thus removing the requirement that instructions are generated to index into the list each iteration of the loop (mostly notable on larger lists).A full list of individual function-level changes is as follows:
bf_ftime
to callVar::new_float
; addVar::new_float
.bf_sort
: make various vars const, remove extra code and simply reverse the vector in place ifreverse
is true. This removes unneeded code around generating two iterators and using two loops based on whether or notreverse
is true. This does mean that a small impact exists for reversing the sorted list, but this impact is minimal.human_string
for background threads to usenullptr
and not 0; no bonus save for readability.Var
structure (mostly makingis_foo
const methods).round
to useVar::new_float
.