We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
アクセスの度にアトリビュートオブジェクトが生成されているので、呼び出しが多いほど無駄になる。 一度生成したら辞書としてキャッシュし、次回からはキャッシュから取り出して利用する。
The text was updated successfully, but these errors were encountered:
デフォルトでキャッシュが有効。MetanObject._cache = False にすることでキャッシュを無効化
import pymel.core as pm import metan.debug as dbg import metan.core as mtn m1 = mtn.M("pCube1") m1._cache = True # default:True m2 = mtn.M("pCube1") m2._cache = False p = pm.PyNode("pCube1") def func(m):m.tx;m.ty;m.tz print dbg.run_profile(func, count=10000)(m1) # 0.116s # metan cache:ON print dbg.run_profile(func, count=10000)(m2) # 1.636s # metan cache:OFF print dbg.run_profile(func, count=10000)(p) # 2.863s # pymel def func1(m):m.t.tx;m.t.ty;m.t.tz print dbg.run_profile(func1, count=10000)(m1) # 0.164s # metan cache:ON print dbg.run_profile(func1, count=10000)(m2) # 3.504s # metan cache:OFF print dbg.run_profile(func1, count=10000)(p) # 4.755s # pymel def func2(m):m.attr("tx");m.attr("ty");m.attr("tz") print dbg.run_profile(func2, count=10000)(m1) # 0.113s # metan cache:ON print dbg.run_profile(func2, count=10000)(m2) # 1.592s # metan cache:OFF print dbg.run_profile(func2, count=10000)(p) # 2.496s # pymel def func3(m):m.attr("wm[0]") print dbg.run_profile(func3, count=10000)(m1) # 0.034s # metan cache:ON print dbg.run_profile(func3, count=10000)(m2) # 0.609s # metan cache:OFF print dbg.run_profile(func3, count=10000)(p) # 7.817s # pymel
Sorry, something went wrong.
No branches or pull requests
アクセスの度にアトリビュートオブジェクトが生成されているので、呼び出しが多いほど無駄になる。
一度生成したら辞書としてキャッシュし、次回からはキャッシュから取り出して利用する。
The text was updated successfully, but these errors were encountered: