Jump to content
과거의 기술자료(읽기 전용): https://tech.devgear.co.kr ×
과거의 기술자료(읽기 전용): https://tech.devgear.co.kr

비주얼 C++을 버리고 델파이로 전환해 60배의 놀라운 속도 향상을 달성한 방법


Recommended Posts

 

Rick Kamenos writes for us today about how he took an enterprise app written in Visual Studio with C++ and rewrote it using our favorite IDE software RAD Studio with Delphi and went from an app which took hours to only a few minutes. It’s quite a compelling endorsement of Delphi considering C++ is often touted as the fastest programming language around!

Rick Kamenos는 비주얼 스튜디오 C++로 구현한 엔터프라이즈 앱을 우리가 선호하는 IDE인 RAD스튜디오, 델파이로 재작성하여 그 결과 몇 시간이 소요되던 앱 처리 시간이 단 몇 분으로 줄어든 경험을 공유해주었다. C++이 종종 가장 빠른 프로그래밍 언어로 알려져 있지만, 델파이의 강력함을 명백히 입증하는 매우 흥미로운 결과 자료이다!

 

목차


 

직면한 문제는 무엇이었나?

An enterprise level organization had multiple systems being built using Visual Studio with C++. These systems were used for important reporting to government agencies, but they kept failing. The company needed solutions that worked and they needed them quickly.

이 엔터프라이즈 급 조직은 비주얼 스튜디오 C++을 사용해 여러 시스템을 구축해왔다. 이 시스템들은 정부 기관에 중요한 보고를 하는데 사용되었지만, 계속해서 실패했다. 이 기업은 작동하는 솔루션이 필요했고, 신속하게 구축해야 했다.

The first of the problems was a data importing system that read information from a CD, then cleaned and transformed the data before importing it into a database warehouse. This process was taking hours and would usually fail before finishing.

첫 번째 문제는 CD에서 정보를 읽어 데이터를 데이터베이스 웨어하우스로 가져오기 전에, 해당 데이터를 정리하고 변환하는 데이터 임포트 시스템이었다. 이 절차는 몇 시간이 소요되었으며, 완료되기 전에 실패하는 경우도 잦았다.

 

이 외 다른 문제는?

The second problem, government reports that were also taking hours and sometimes would not finish. These reports relied on data from the first problem and additional data being generated inside the organization.

두 번째 문제는 정부 리포트 또한 오랜 시간이 걸렸고 완료되지 않는 경우도 많았다. 이 리포트들은 첫 번째 문제에서 언급된 데이터와 조직 내부에서 생성되는 추가 데이터에 의존했다.

spacer.png

 

문제를 해결한 방법

The first thing to fix, of course, was the data importing. The second problem relied on this data to ensure reports were up-to-date and having good data was a must. I looked over the C++ code and found it to be mediocre level programming. Not only that, but I was seeing some code that was supported by components on the Delphi palette. This told me it was probably best just to re-write everything in Delphi. One of Delphi’s greatest strength’s is supporting RAD development by using a strongly typed language and components that make enterprise systems development quick and easy.

물론 가장 먼저 해결해야 할 문제는 데이터 가져오기였다. 그리고 두 번째는 이 데이터에 기반해 리포트를 최신 상태로 유지하는 것이었고, 좋은 데이터를 확보하는 것이 필수였다. C++ 코드를 살펴본 결과, 평범한 수준의 프로그래밍이었다. 그리고 델파이 팔레트에서 컴포넌트로 지원되는 것과 같은 코드들을 확인할 수 있었다. 이걸 보자, 모든 것을 델파이로 다시 작성하는 것이 가장 최선이라는 생각이 들었다. 델파이의 가장 큰 강점 중 하나는 엔터프라이즈 시스템을 신속하고 손쉽게 개발할 수 있는 강력한 형식화된 언어와 컴포넌트가 있어, 이를 개발에 활용할 수 있다는 점이다.

 

데이터 저장  문제는 어떤 방식으로 해결했는가?

The database records were stored on the CD in simple comma-delimited format, but in varying length fields. So, I requested the data fields be changed to fixed length. This meant I could read in one whole record as a chunk and instantly type cast it, so to speak, to the fields it contained.

데이터베이스 레코드는 쉼표로 구분하는 단순한 형식으로 CD에 저장되어 있었지만, 필드 길이가 다양했다. 그래서 데이터 필드를 고정 길이로 변경할 것을 요청했다. 이렇게 하면 하나의 레코드를 한 번에 전체적으로 읽고, 그 안에 포함된 필드로 즉시 형변환(type cast) 할 수 있었다.

After that, it was simply a matter of applying some data anomaly tests and string transformation rules to get the data ready to pump into the data warehouse. Using the Delphi database components, I then just imported each “washed” record into the database using only a few lines of code. Another wonderful advantage brought to enterprise development by Delphi – excellent database components that work fast and are easy to link up, for even the most complex applications.

그 후에는 데이터 이상 검사와 문자열 변환 규칙을 적용해 데이터를 데이터 웨어하우스로 펌프하는 준비 작업이 단순해졌다. 델파이 데이터베이스 컴포넌트를 사용해 단 몇 줄의 코드만 입력해 "정비된" 레코드를 데이터베이스로 가져왔다. 이렇게 델파이는 엔터프라이즈 개발에 놀라운 이점을 제공해주었다. 델파이의 뛰어난 데이터베이스 컴포넌트들은 가장 복잡한 애플리케이션도 빠르게 작동하고 손쉽게 연결할 수 있도록 해주었다. 

A quick test and we went from hours, to minutes, for importing. A few components and not much code but we were light years ahead of what this company had in place prior to using Delphi. Which is good, because they were having many problems that were frustrating management.

간단한 테스트를 통해 가져오는 시간이 몇 시간에서 단 몇 분으로 단축되는 것을 확인할 수 있었다. 몇 가지 컴포넌트와 많지 않은 코드만으로도, 델파이를 사용하기 전에 회사에서 사용하던 그 어떤 것들보다 몇 년은 앞서게 된 것이다. 그 전까지는 경영진을 괴롭히던 많은 문제들이 있었기 때문에 이는 분명 좋은 일이었다.

The second thing to fix was the reports. There were various reports being generated. All going to government agencies for review. The data in those reports had to be put into an Excel file format. Those spreadsheets would then be used to perform calculations on the data and those results were reviewed and the files then archived.

다음으로 고쳐야 할 것은 리포트였다. 여러 리포트가 생성되고 있었다. 그리고 이 모든 리포트는 검토를 위해 정부 기관으로 보내졌다. 리포트의 데이터는 엑셀 파일 형식으로 입력해야 했다. 이 스프레드시트들은 데이터에 대한 계산을 하고, 그 결과를 검토한 다음 보관되었다.

spacer.png

 

 

비주얼 스튜디오와 C++에서 델파이로 변경한 것이 어떤 도움이 되었는가?

Delphi to the rescue! There were components available with Delphi that would open, read and write to the excel file format. The solution, then, was merely a small application that connected to the data warehouse using the available database components. A query opened to retrieve the data and using the excel components, write that data to the excel file. Placing it in the proper spreadsheet cells, to allow the spreadsheet to provide the proper results.

델파이가 구해주었다! 델파이에는 엑셀 파일 형식을 열고, 읽고, 쓸 수 있는 컴포넌트를 제공한다. 당시 솔루션은 단지 데이터베이스 컴포넌트로 데이터 웨어하우스에 연결하는 작은 애플리케이션에 불과했다. 쿼리를 열어 데이터를 검색하고, 엑셀 컴포넌트로 해당 데이터를 엑셀 파일에 작성한다. 그리고 적절한 스프레드시트의 셀에 이 데이터를 배치해 스프레드시트가 적합한 결과를 제공할 수 있도록 했다.

All’s well that ends well and with Delphi, that’s usually the case. Another thing to mention, is that I went ahead and created a menu extension coupled with a server extension that allowed management to review the reports and if all was working correctly, send them to the proper agency by simply right clicking the spreadsheet file and then clicking the “Remit To” menu option. Then a list of agencies would appear and by selecting the proper agency the file would be FTP’ed over by the server.

모든 것이 잘 마무리되었다. 델파이를 사용하면 일반적으로 모든 것이 잘 된다. 또 하나 언급하고 싶은 점은, 나는 서버 확장을 결합한 메뉴 확장을 만들었는데 이를 통해 리포트 보고 관리를 가능하게 했고, 모든 것이 올바르게 작동한다면 이를 적합한 기관에 전송할 수 있도록 했다. 이 작업은 심플하게 스프레드 파일을 마우스 오른쪽 버튼으로 클릭한 다음 "Remit To" 메뉴 옵션을 클릭하기만 하면 되었다. 그러면 기관 목록이 표시되는데, 올바른 기관을 선택하면 서버가 파일을 FTP로 전송되는 것이었다.

Another complex problem solved, using Delphi to create a simple solution. One that worked great and was easy to complete.

델파이로 간단한 솔루션을 만들어 여러 복잡한 문제들을 해결할 수 있었다. 이 솔루션 또한 잘 작동했으며, 마무리 또한 쉬웠다.

 

spacer.png

 

 

이 댓글 링크
다른 사이트에 공유하기

  • RAD changed the title to 비주얼 C++을 버리고 델파이로 전환해 60배의 놀라운 속도 향상을 달성한 방법

이 토의에 참여하세요

지금 바로 의견을 남길 수 있습니다. 그리고 나서 가입해도 됩니다. 이미 회원이라면, 지금 로그인하고 본인 계정으로 의견을 남기세요.

Guest
이 토픽(기고/질문)에 답하기

×   서식있는 텍스트로 붙여넣기.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   이전에 작성한 콘텐츠가 복원되었습니다..   편집창 비우기

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

중요한 정보

이용약관 개인정보보호정책 이용규칙 이 사이트가 더 잘 작동하기 위해 방문자의 컴퓨터에 쿠키가 배치됩니다. 쿠키 설정 변경에서 원하는 설정을 할 수 있습니다. 변경하지 않으면 쿠키를 허용하는 것으로 이해합니다.