Repository navigation
Closed
TravelMapping/DataProcessing
#416Description
DataProcessing/siteupdate/python-teresco/siteupdate.py
Lines 2310 to 2325 in 79bf1cd
| for v in self.vertices.values(): | |
| # all vertices for simple graph | |
| simplefile.write(v.unique_name+' '+str(v.lat)+' '+str(v.lng)+'\n') | |
| v.s_vertex_num = sv | |
| sv += 1 | |
| # visible vertices... | |
| if v.visibility >= 1: | |
| # for traveled graph, | |
| travelfile.write(v.unique_name+' '+str(v.lat)+' '+str(v.lng)+'\n') | |
| v.t_vertex_num = tv | |
| tv += 1 | |
| if v.visibility == 2: | |
| # and for collapsed graph | |
| collapfile.write(v.unique_name+' '+str(v.lat)+' '+str(v.lng)+'\n') | |
| v.c_vertex_num = cv | |
| cv += 1 |
DataProcessing/siteupdate/python-teresco/siteupdate.py
Lines 2394 to 2409 in 79bf1cd
| for v in mv: | |
| # all vertices, for simple graph | |
| simplefile.write(v.unique_name + ' ' + str(v.lat) + ' ' + str(v.lng) + '\n') | |
| v.s_vertex_num = sv | |
| sv += 1 | |
| # visible vertices | |
| if v.visibility >= 1: | |
| # for traveled graph | |
| travelfile.write(v.unique_name + ' ' + str(v.lat) + ' ' + str(v.lng) + '\n') | |
| v.t_vertex_num = tv | |
| tv += 1 | |
| if v.visibility == 2: | |
| # for collapsed graph | |
| collapfile.write(v.unique_name + ' ' + str(v.lat) + ' ' + str(v.lng) + '\n') | |
| v.c_vertex_num = cv | |
| cv += 1 |
Would it save a noticeable amount of time to store & retrieve v.unique_name + ' ' + str(v.lat) + ' ' + str(v.lng) + '\n' rather than calculate it 3 times?
DataProcessing/siteupdate/python-teresco/siteupdate.py
Lines 1733 to 1735 in 79bf1cd
| # printable string | |
| def __str__(self): | |
| return self.unique_name |
doesn't appear to be used. We could repurpose it. Or not.
Activity
yakra commentedon Jan 21, 2023
vstris calculated for the master graph, and again for every subgraph.Store
self.tmg_lineupon construction and refer to that instead.yakra commentedon Jan 29, 2023
On second thought, naah.
System monitor suggests this takes an add'l 71.9 MiB.
tail -n +3 tm-master-simple.tmg | head -n 801850 | wc -c= 28,695,406, or 27.4 MiB.Add in 49 B per string container and that's 28695406 + 39290650 = 67986056, or 64.8 MiB.
The remaining difference works out to 9B per -- 8 B to point to each object from the
HGVertex+ 1 more byte, well within margin of error at this point.But yeah no. I don't feel like this is worth wasting 71.9 MiB more over.