mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
fixes tech disk uploading taking 5 seconds of total cpu (#90005)
## About The Pull Request idk if the master crash thing was effectively solved in the last week but now it is, uploading the debug tech disk has gone from 5 seconds of total cpu to 0.58 seconds. also since it filters out already added designs and nodes more it costs much less to upload it redundantly than before. before (uploading disk to web and web to disk) [message(5).txt](https://github.com/user-attachments/files/19205791/message.5.txt) uploading 1 time [message(3).txt](https://github.com/user-attachments/files/19205746/message.3.txt) uploading 7 times [message(4).txt](https://github.com/user-attachments/files/19205756/message.4.txt) ## Why It's Good For The Game why did it take 5 seconds to go over 1000 things? because it was redundantly doing things 10,000s of times ## Changelog 🆑 refactor: tech disk uploading isnt super slow anymore (much harder to crash spacetime with it) /🆑 --------- Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
co-authored by
LemonInTheDark
parent
4cab2cd938
commit
fcade1b140
@@ -149,10 +149,10 @@
|
||||
CHECK_TICK
|
||||
if(get_available_nodes()[i] || get_researched_nodes()[i] || get_visible_nodes()[i])
|
||||
receiver.hidden_nodes -= i //We can see it so let them see it too.
|
||||
for(var/i in researched_nodes)
|
||||
for(var/i in researched_nodes - receiver.researched_nodes)
|
||||
CHECK_TICK
|
||||
receiver.research_node_id(i, TRUE, FALSE, FALSE)
|
||||
for(var/i in researched_designs)
|
||||
for(var/i in researched_designs - receiver.researched_designs)
|
||||
CHECK_TICK
|
||||
receiver.add_design_by_id(i)
|
||||
receiver.recalculate_nodes()
|
||||
@@ -486,7 +486,7 @@
|
||||
return
|
||||
if(researched)
|
||||
researched_nodes[node.id] = TRUE
|
||||
for(var/id in node.design_ids)
|
||||
for(var/id in node.design_ids - researched_designs)
|
||||
add_design(SSresearch.techweb_design_by_id(id))
|
||||
else
|
||||
if(available)
|
||||
|
||||
Reference in New Issue
Block a user