qunat / Pythonocc-CAD

Lightweight 3d software based on pythonocc
GNU Lesser General Public License v3.0
94 stars 25 forks source link

您好 如果我想把读取step格式文件的速度变快 应该如何操作呢?可否交流一下 #2

Open 1997coda opened 12 months ago

1997coda commented 12 months ago

我尝试使用多线程来改进 但是好像效果不大 有什么好用的算法来改进吗 感谢 stepanalyzer.txt

1997coda commented 12 months ago

现在一个20mb的step文件大概需要36-40s 硬件是i5 12500 显卡3060

qunat commented 12 months ago

你好 !       这个问题也是我一直困扰着我。 首先由于python的GIL锁,对于io密集型 多线程并没有用。我最近也是研究了一下,读取step的过程,因为读取时属于计算机io 所以可以尝试使用异步io asyncio 模块。至于这么解决我也没还没有实现,但我在尝试去解决他。

楼建迪 @.***

原始邮件

发件人:"codazq"< @.*** >;

发件时间:2023/9/12 22:58

收件人:"qunat/Pythonocc-CAD"< @.*** >;

抄送人:"Subscribed"< @.*** >;

主题:Re: [qunat/Pythonocc-CAD] 您好 如果我想把读取step格式文件的速度变快 应该如何操作呢?可否交流一下 (Issue #2)

现在一个20mb的step文件大概需要36-40s 硬件是i5 12500 显卡3060

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

1997coda commented 12 months ago

感谢回复 顺便小小咨询一下 您用了啥scientific algorithm去解决technical issues

非常抽象 我想用我本科写的cad软件水一下毕业论文 (垃圾海硕)这个导师非让我用一个算法去解决技术性问题。我寻思一个cad能打开能看 能动两下 opencascade直接用不就完事了。

想了下打开step文件快一点是不是可以 居然跟我说多线程是“mostly related to engineering and implementation”。。我是真的麻了

您如果又用了啥scientific algorithm还望救命啊。

倒苦水和中英夹杂真的抱歉了 Orz

1997coda commented 12 months ago

你好 虽然没搞懂原理,但是使用官方那个cad-assitant 读取再保存后,读取时间变为28s。 不过cadassitant读取只要16s 我真的很好奇如何做到的。

qunat commented 12 months ago

如果我说是因为开发语言本身的速度问题 你是否会觉得牵强  你也可以尝试一下其他基于occ的开源项目的读取时间。 比如mayo 一个使用c++ 的opencascade开源项目 https://github.com/fougue/mayo

楼建迪 @.***

原始邮件

发件人:"codazq"< @.*** >;

发件时间:2023/9/13 2:07

收件人:"qunat/Pythonocc-CAD"< @.*** >;

抄送人:"loujiand"< @. >;"Comment"< @. >;

主题:Re: [qunat/Pythonocc-CAD] 您好 如果我想把读取step格式文件的速度变快 应该如何操作呢?可否交流一下 (Issue #2)

你好 虽然没搞懂原理,但是使用官方那个cad-assitant 读取再保存后,读取时间变为28s。 不过cadassitant读取只要16s 我真的很好奇如何做到的。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

1997coda commented 12 months ago

如果我说是因为开发语言本身的速度问题 你是否会觉得牵强  你也可以尝试一下其他基于occ的开源项目的读取时间。 比如mayo 一个使用c++ 的opencascade开源项目 https://github.com/fougue/mayo。 楼建迪 @. 原始邮件 发件人:"codazq"< @. >; 发件时间:2023/9/13 2:07 收件人:"qunat/Pythonocc-CAD"< @. >; 抄送人:"loujiand"< @. >;"Comment"< @. >; 主题:Re: [qunat/Pythonocc-CAD] 您好 如果我想把读取step格式文件的速度变快 应该如何操作呢?可否交流一下 (Issue #2) 你好 虽然没搞懂原理,但是使用官方那个cad-assitant 读取再保存后,读取时间变为28s。 不过cadassitant读取只要16s 我真的很好奇如何做到的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

还有这种操作。 我想了下多线程不行 多进程不知道可不可以。小弟才疏学浅这块不是很会。多进程是只能优化打开多个step文件那种情况嘛?