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

Add simple tutorial on optimizing code with ctypes or numpy for beginners #2370

Draft
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

eschan145
Copy link
Contributor

No description provided.

@eschan145 eschan145 changed the title Add simple tutorial on optimizing code with ctypes or numpy Add simple tutorial on optimizing code with ctypes or numpy for beginners Sep 22, 2024
@DragonMoffon
Copy link
Collaborator

Does this page have a reference to Arcade Accelerate at all? Especially for collisions, it is where we want to lead new developers. Also, we recommend using rust over ctypes (though keep the details on ctypes as it is very helpful). It has a much nicer developer experience.

@pushfoo
Copy link
Member

pushfoo commented Sep 30, 2024

TL;DR: This whole page needs some thought before I comment in-depth on this.

We may want to split performance into multiple pages. I need to look at some dependency issues for both 3.0 and the maybe-2.6.18 EOL release before coming back to this.

@einarf
Copy link
Member

einarf commented Oct 5, 2024

This definitely needs a lot more thought into it. We need to maintain this document for years to come so covering the most relevant things based on experience from interaction with arcade users is likely the way to go?

I think the sections here are too vague or incomplete. "Algorithms and Raw Performance" however is a good idea to cover, but there are a lot more to cover other than the trivial case shown in the doc. I'm not sure how useful it is in its current state.

Optimizing using numpy is a complex topic. However the sin / cos functions shown in the document are actually slower than then standard library so I don't understand the purpose of those. If we are going to cover numpy it would need to highlight its strengths: Doing batch operations on larger arrays of data. Numpy arrays are also VERY useful in with arcade.gl because of the buffer protocol support meaning you can pass the raw internal memory of the array directly into textures and buffers without converting this data into python types (very costly).

The "Using cypes" section i think can instead be something more generic not necessarily mentioning specifics. There are so many options today, not only C/C++. I don't think we should go into specifics and I would be careful linking to content that might disappear in the future.

@DragonMoffon DragonMoffon added this to the Future milestone Oct 17, 2024
@DragonMoffon
Copy link
Collaborator

Converting to a draft PR because there is much more work to be done on this part of the docs.

@DragonMoffon DragonMoffon marked this pull request as draft October 17, 2024 11:54
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.

4 participants