working on the dfmemwrite-related func. performance