Swift : Fast Dictionary Load?

I am attempting to load a dictionary (it represents a Listbox contents)

as such each “cell” is an entry. so to load 5000 rows with 5 columns is 25,000 entries

private final func putCell(_ row:Int,_ col: Int,_ data : cellRecord) {
let key = cellCoor(row:row,col:col)

this takes 4.6 seconds… all the rest of the overhead (prepare the data, etc, takes 0.02 seconds)

any ideas?

Using a 2D Dictionary reduced the load time to 0.5 seconds!!!

private var dataStore: Dictionary = [Int : [Int : cellRecord] ]() //   0.522895541 seconds
1 Like