Marchowes / pyProm

Surface Network Analyzer.
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

[Optimization] faster dict lookup: #78

Closed Marchowes closed 6 years ago

Marchowes commented 6 years ago

Several lookup tables function as such: {x1:[y1,y2,y3,y4], x2[y1,y2,y3,y4] ....} for identifying if X,Y have been already looked at (or for other general storage).

It will likely be faster if we engage in sneakiness and have a hash of a hash like so: {x1:{y1:True, y2:True, y3:True}, x2:{y1:True, y2:True} ...} that way its 2 O1 operations instead of an O1, On operation.

Marchowes commented 6 years ago

https://stackoverflow.com/questions/38987/how-to-merge-two-dictionaries-in-a-single-expression

Marchowes commented 6 years ago

This'll be released in 0.3.7 seeing performance gains of 33 - 50%

Marchowes commented 6 years ago

done.