튜브 연결하기 #9 (Connecting Tubes)

김강진·2023년 2월 3일

전반적인 속도를 측정하며 개선해보았다. 속도 개선이 그렇게 어려운 일은 아니었다. 가장 큰 요인은 draw() 함수를 많이 사용했던 것과 sleep() 함수가 중간에 사용되었던 점, 그리고 print() 문이 매우 남아있었던 것이었다. 필요한 만큼만 남기고 모두 지웠더니 결과가 좋아졌다. 약 3초 정도면 전체 drawing이 되는 것 같다. 여기에 추후 tube 기능이 완성되면 tube를 숨길 수 있어서 속도는 더 개선될 것으로 예상된다. 하지만, 한 가지 사소한 문제가 발생하였다. 아래 그림을 보면, 위성 노드 두 개가 근접해 있는 것을 볼 수 있다. 이것 때문에 노드의 경계를 다시 계산해야 할 필요가 있고, 이 부분의 코드는 꽤 복잡해질 것 같다.

While measuring the time, I attempted to enhance the overall program speed. It wasn't difficult to reduce the running time. The misuse of the draw() method, the interim use of the sleep() function, and the remaining print() function in the code were the significant factors. The outcome improved once they were removed and only the relevant pieces remained. Drawing everything looked to take roughly 3 seconds. Furthermore, once the functionality of tubes has been implemented, tubes can be buried later, resulting in even more speed improvements. However, one minor issue was discovered. Two satellite nodes are depicted in close proximity in the diagram above. Because of this circumstance, I may need to recompute the node border, which would make this particular function much more complicated.

profile
전산학도

0개의 댓글