archive
archive copied to clipboard
Improve performance request
Thank you for this nice library.
I see that all your functions are sync. Is there any plan to provide async commands ?
How does it help with the performance? You can turn a sync function to async in your code. See this aricle.
Example
import 'dart:async';
import 'dart:math';
void main() async {
Future.microtask(_heavySyncFunction).then((value) => print('Heavy stask finished'));
print('Heavy stask started');
}
void _heavySyncFunction() {
var nums = List.generate(100000000, (i) => i);
for (int i = 0; i < nums.length; i++) {
nums[i] = sqrt(nums[i]).toInt();
}
}