oem: ibm: Use `truncate(1)` to create NVRAM related files
Use of `dd(1)` results in back-to-back `read(2)` and `write(2)` syscalls;
the performance of `dd(1)` is O(n) with respect to the file size. Poor
choice of the `bs=` parameter to `dd(1)` can significantly amplify the
amount of syscalls required to achieve the task.
By contrast, `truncate(1)` generally invokes a single syscall, either
`truncate(2)` or `ftruncate(2)`. As a consequence, `truncate(1)` is O(1)
with respect to file size.
Switch to `truncate(1)` to improve runtime efficiency of the scripts.
Signed-off-by:
Andrew Jeffery <andrew@aj.id.au>
Change-Id: I69dd925f36e733fc2a1ee71cb8354ee04ee8871b
Loading
Please register or sign in to comment