Ok, it seems I found an answer. See this SO question and answer, explaining why using allKeys
method is bad.
As long as you don't add or remove any elements from the dictionary, they will remain in the same order, but as soon as you add or remove an element, the new order will be completely different.