Switching from 1.2.1 to 2.x.x drastically slows my app
- Dominant language
- Dart
- Stars
- 275
- Forks
- 144
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 47
Description
In my app I allocate realtime video frames (24MB per frame * 60fps)
In my app I time the processing of a frame in milliseconds.
Using `ffi: ^1.2.1` I get 8-11ms per frame
Using `ffi: ^2.0.0` I get 70 to 200ms per frame in DEBUG mode and 20-30ms in RELEASE mode which makes my app unusable.
I suspect that it has something to do with the switch mentioned in the changelog of 2.0.0
> Switch Windows memory allocation to use CoTaskMemAlloc and CoTaskMemFree
I've also found an article that talks about a bug in windows 10 which supposedly makes this a lot slower:
https://randomascii.wordpress.com/2022/07/11/slower-memory-zeroing-through-parallelism/
For now I can't upgrade to ffi 2.x.x since I can't use my app with this version.
Is this a known thing?
EDIT: switching from ffi.calloc to ffi.malloc reduces the time immensly but of course is not always applicable
Contributor guide
Assessment
This issue has not been assessed yet.