Repository navigation
Closed
Description
It appears we calculate & store data here, but never retrieve & use it.
DataProcessing/siteupdate/python-teresco/siteupdate.py
Lines 3347 to 3353 in 3d56bd9
| # "traveled" dictionaries indexed by system name, then conn or regular | |
| # route in another dictionary with keys route, values mileage | |
| # "clinched" dictionaries indexed by system name, values clinch count | |
| t.con_routes_traveled = dict() | |
| t.con_routes_clinched = dict() | |
| t.routes_traveled = dict() | |
| #t.routes_clinched = dict() |
| std::unordered_map<HighwaySystem*, std::unordered_map<ConnectedRoute*, double>> con_routes_traveled; // mileage per ConRte per system | |
| // TODO is this necessary? | |
| // ConRtes by definition exist in one system only | |
| std::unordered_map<Route*, double> routes_traveled; // mileage per traveled route | |
| std::unordered_map<HighwaySystem*, unsigned int> con_routes_clinched; // clinch count per system | |
| //std::unordered_map<HighwaySystem*, unsigned int> routes_clinched; // commented out in original siteupdate.py |
- Getting rid of these structures & their contents should free up some RAM, and maybe speed things up a tiny bit.
- userlog.cpp:
system_con_umap(system_con_dictin Python) can also go bye-bye.
Activity
yakra commentedon Nov 23, 2020
By "a tiny bit", I mean "54.7% faster Creating per-traveler stats logs and augmenting data structure on BiggaTomato, C++, 4 threads."
This calls for making a pretty graph. Haven't done one of those in a while.
(Did 53ca19d slow us down a tiny bit?) No!
Not on lab2 at least. Didn't bother testing anywhere else.
yakra commentedon Nov 23, 2020
Heh, nope. Small sample size (1) + not too tightly controlled testing conditions led to an inflated time for the old code.
There is some improvement, but it's much smaller.
yakra commentedon Dec 10, 2020
HighwayData @ aeaeb953348711a4265e31f66031af1d362485a8UserData @ f5458d401b8a7856efae631fe2b89d11d56bc4b2Saves about 11.3 MB C++ & 13.2 MB Python, plus whatever overhead may exist within the hash table structures themselves.