Skip to content
New issue

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

Optimization using numba and numpy #13

Closed
wants to merge 1 commit into from
Closed

Optimization using numba and numpy #13

wants to merge 1 commit into from

Conversation

Juksten
Copy link

@Juksten Juksten commented Dec 16, 2019

No description provided.

@ScottishCyclops
Copy link
Owner

Thank you so much for your contribution !
I do not know much about numpy, so I am not the best person to review your code.

Did you run tests to check the performance improvements ?
You can use my addon that measures average viewport FPS.

https://github.com/ScottishCyclops/viewport-fps

Furthermore, and correct me if I'm wrong, in order to use numpy a regular Blender user would need to manually install it beforehand.
As such, it becomes a bit less user friendly.
That is why I would see the "numpy version" as an alternate version.

If you think that could be a good idea, I'll create a "numpy" branch, and you can push this commit to that new branch.

Scott

@Juksten
Copy link
Author

Juksten commented Dec 19, 2019

Numpy is preinstalled with blender 2.8 but Numba need to be installed with pip.

On Windows this can be done from powershell with following commands (assuming default Blender installation folder):

'cd 'C:\Program Files\Blender Foundation\Blender 2.81\2.81\python\bin'' and

'.\python.exe -m pip install numba'.

Performance FPS test in solid viewport with default subdivided cube(1st value modified code 2nd original):
Only colors:
1.5k verts >100, 22
6k verts 75, 6.5
25k verts 23, 1.7
100k verts 6.2, 0.4
400k verts 1.5, not responding
Only vertex groups:
1.5k verts 65, 34
6k verts 29, 11
25k verts 9, 3
100k verts 2.3, 0.7
400k verts 0.6, 0.2
Vertex groups + colors:
1.5k verts 58, 20
6k verts 24, 5.8
25k verts 7.3, 1.5
100k verts 1.9, 0.4
400k verts 0.5, not responding

Due to changes in code there may be errors which may not be related with original script.
I didnt tested it enough to be sure that there are no bugs, but im using it in my project
without any problems.

Thus probably the best solution as you said is to make a new branch with modified version of addon.

@ScottishCyclops
Copy link
Owner

Impressive !
I created the numba branch.
I will try to merge this pull request on the new branch using command line.
If I can't do it, I'll ask you to make a new pull request on the correct branch.

@ScottishCyclops
Copy link
Owner

Worked. I'll check the code out when I have time.
I'll say in the branch's readme that it is "experimental" or something.

@VincentKueszter
Copy link

@ScottishCyclops Would you merge it to master if installing numba was done via GUI in Blender?(similar to how DECALmachine does it)
2020-01-26 11_32_02-Blender Preferences

@ScottishCyclops
Copy link
Owner

@ScottishCyclops Would you merge it to master if installing numba was done via GUI in Blender?(similar to how DECALmachine does it)
2020-01-26 11_32_02-Blender Preferences

That sounds like a good idea. That can be implemented in the numba branch for now.
I won't remove the base branch for now because I don't have time to relearn numba to fully transition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants