improve objsets performance and add test code