You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
move-stdlib has some unnecessary inefficiencies in the basic libraries for vectors and strings. For instance:
public fun append<Element>(lhs: &mut vector<Element>, other: vector<Element>) {
reverse(&mut other);
reverse_append(lhs, other);
}
public fun reverse_append<Element>(lhs: &mut vector<Element>, other: vector<Element>) {
let len = length(&other);
while (len > 0) {
push_back(lhs, pop_back(&mut other));
len = len - 1;
};
destroy_empty(other);
}
The reverse operation is unnecessary if this would be implemented on native level.
There might be other cases. Moreover, in some cases missing functions (like replace on string) need native implementations to be really efficient, and should therefore be added.
The text was updated successfully, but these errors were encountered:
move-stdlib has some unnecessary inefficiencies in the basic libraries for vectors and strings. For instance:
The
reverse
operation is unnecessary if this would be implemented on native level.There might be other cases. Moreover, in some cases missing functions (like
replace
on string) need native implementations to be really efficient, and should therefore be added.The text was updated successfully, but these errors were encountered: