Buffered I/O: Python's file handling process is buffered, accumulating data in memory before disk access(RAM). Dart’s synchronous I/O (writeSync and readSync) lacks buffering, leading to more overhead for each disk access, which slows performance for large data.
System Libraries and Encoding: Python uses POSIX-compliant, platform-optimized libraries, which enhance I/O efficiency on macOS. Dart's library may lack such optimizations, and default UTF-8 encoding or newline differences (\r\n vs. \n) could add processing overhead in Dart.
Dart’s synchronous I/O adds latency as each of the operations waits for completion. Dart’s asynchronous I/O, being non-blocking, allows overlapping operations and can improve speed for large files.