Code: Select all
iter := dict.createIterator;
iter.startAtObject(obj);
iter.getCurrentKeys(aKey);
Code: Select all
iter := dict.createIterator;
iter.startAtObject(obj);
iter.getCurrentKeys(aKey);
Sorry, I guess that wasn't clear - you'd pass the object you wanted the keys for, for example dict.getObjectKeys(obj, aKey). As you say, it would be like Array::getIndex. It just seems unnecessary to have to create an Iterator etc. when I have the dictionary and I have the object and I just want to get the key.I can't see how you could get keys from just a Dictionary, as it needs to know which object you are requesting the keys for.
That would explain why it's slow to get the keys using iter.startAtObject(obj); iter.getCurrentKeys(aKey); - I assume startAtObject is getting to the object in a slow way.The Btrees used by Dictionaries are not structured to do this and so it would either be very inefficient (e.g. linear search) or would require a separate internal index structure keyed by oid (much additional overhead and space).
Code: Select all
process.setObjectCachePriority(obj1, 0);
Ooo, I didn't know about thatCode: Select all
process.setObjectCachePriority(obj1, 0);
Return to “General Discussion”
Users browsing this forum: No registered users and 26 guests