[sharedlibrary] Improve performance.