3
arcsector
45d

Optimization concepts/patterns or instances?

For pattern its gotta be any time i can take a O(n^2) and turn it into O(n) or literally anything better than O(n^2).

Instance would probably be the time that we took an api method that returned a json list made up of dictionaries CSV-style and changed it into a dictionary with the uid as the key and the other info as key-value pairs in a sub-dictionary. So instead of:

[
{
"Name": name,
"Info":info
}
]

We now return:

{
name:
{
"Info": info
}
}

Which can, if done right, make your runtime O(1), which i love.

Comments
Add Comment