누군가 파이썬 멀티 스레딩의 가능한 방법은 무엇입니까? 하나의 XML 파일 (163MB)이 있습니다. 내 작업은 이미이 Python 멀티 쓰레딩을 사용하여 XMl에서 DB에 삽입하는 방법은 무엇입니까?
로그 파일에
- 에 필요 위의 1,2 단계를 수행하는 xml 파일을 읽는 파이썬 코드. 사실, 멀티 스레드를 사용하여 프로세스 속도를 높이고 싶습니다. 나는 일을 시작하는 방법을 모른다.
다음은 XML 구조입니다.
<Content id="359366"> <Title>This title</Title> <SortTitle>sorting</SortTitle> <PublisherEntity id="2003">ABC Publishing Group</PublisherEntity> <Publisher>ABC Publishing Group</Publisher> <Imprint>Revell</Imprint> <Language code = "en">English</Language> <GeoRight> <GeoCountry code = "WW" model = "Distribution">World</GeoCountry> </GeoRight> <Format type = "Adobe EPUB eBook"> <Identifier type = "DRMID">xxx-xxx-xx</Identifier> <Identifier type = "ISBN">1234567</Identifier> <SRP currency = "SGD">18.89</SRP> <WholesaleCost currency = "SGD">11.14</WholesaleCost> <OnSaleDate>01 Sep 2010</OnSaleDate> <MinimumSoftwareVersion number="1.x">Adobe Digital Editions</MinimumSoftwareVersion> <DownloadFileName>HouseonMalcolmStreet9781441213877</DownloadFileName> <SecurityLevel value="ACS4">Adobe Content Server 4</SecurityLevel> <ContentFileSize>473923</ContentFileSize> <DownloadUrl>http://xxx.xx.com/</DownloadUrl> <DownloadIDType>CRID</DownloadIDType> <DrmInfo> <Copy> <Enabled>1</Enabled> <Selections>2</Selections> <Interval type = "Days">7</Interval> </Copy> <Print> <Enabled>1</Enabled> <Selections>20</Selections> <Interval type = "Days">7</Interval> </Print> <Lend> <Enabled>0</Enabled> </Lend> <ReadAloud> <Enabled>0</Enabled> </ReadAloud> <Expires> <Enabled>0</Enabled> <Interval type = "Days">-1</Interval> </Expires> </DrmInfo> </Format> <Creator rank="1" id="923710"> <Name>name</Name> <FileAs>Kelly, Leisha</FileAs> <Role id="aut">Author</Role> </Creator> <SubTitle>A Novel</SubTitle> <Edition></Edition> <Series></Series> <Coverage></Coverage> <AgeGroup></AgeGroup> <ContentType></ContentType> <PublicationDate>09/01/2010</PublicationDate> <ShortDescription>description</ShortDescription> <FullDescription>full desc</FullDescription> <Image type = "Cover Image">http://xxx.xx.jpg</Image> <Image type = "Thumbnail Image">http://xxx.xx.jpg</Image> <Subject code="FIC000000">Fiction</Subject> <Subject code="FIC014000">Historical Fiction</Subject> </Content>
여기에 기존 파이썬 코드 download이 있습니다.
나는 현재 코드를 프로파일 링하고 다른 측면이 얼마나 오랫동안 작용하는지 제안 할 것을 제안합니다. 필자는 멀티 스레딩이 필연적으로 작업 속도를 높일 것이라고 생각하지 않습니다. – MattH
감사합니다. xml 구조 및 현재 코드 파일 – hhkhaing