[sc-memory] Improve test, add some profiling. Improve speed