-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Debug the trisurf code #550
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
Conversation
Just to have your comment here as well:
|
Actually hold up a sec on this one, looking through the code I think I see a few more bugs...I'll comment on them in this PR |
It looks like a bunch of bugs got introduced whenever somebody added the colorbar functionality. E.g., right now if you don't give a colormap, then it throws an error. Moreover, it looks like the output of the |
Also I'm not sure why but the current version re-converted |
maybe @Kully or @theengineear can comment on this one? |
(on the plus side, it does seem like the memory leak is not happening. It's a bit hard to tell because my original code isn't working due to the above changes, but seems promising) |
This was done as a simple fix to make tests work between Python 2 and Python 3. That's really the only important rationale for it. I figured that it wouldn't be too much of a performance knock if it happened once at the end, which is why I suggested it to @Kully. That said, I haven't looked at the actual implications and there's no other reason to have a list over a numpy array, so we can definitely change that back. |
Cool - I seem to remember arrays being a lot more efficient than lists in the JSON encoding, but I just tried it out and didn't see a difference: Maybe there were optimizations made to the JSONEncoder class? Either way, that was why I was pushing for objects to be made into arrays before being put in the plotly dictionaries. Maybe the performance differences only come up when they're really large lists/arrays or something. |
^^ Yah, that A couple notes:
There's likely a better way, right now this is basically, encoding, unencoding, and then encoding... It had to do with either Plotly backend or plotlyjs code not being able to work with the Feel like digging in 😛? |
Might not be relevant for this processing step, but one of the render speedup tests we've been evaluating (with positive results so far) is the use of JavaScript typed arrays for input. This can avoid expensive array copies, which matter a lot when a model is large. It usually requires arrays of different shape compared to the current API (e.g. As a result, we see that the largest single use of the initial render time is taken by the actual CPU->GPU memory copy (we want to cut down on it too e.g. by using A conclusion is that due to faster JavaScript processing, any array preprocessing in Python, and the (presumable) array copy, or serialization/parsing from Python to Javascript will likely become a significant chunk of the overall processing time, assuming larger meshes, from hundreds of thousands of triangles. These details partly belong to the render speedup issue, @choldgraf please consider opening it in |
There is some old thread on efficiently moving |
It looks like a fairly direct approach would be to use |
|
@monfera super interesting conversation. I agree that this serialization step (when operating in offline mode, or some sort of local mode) is just causing delays. I wonder if this is the appropriate thread to talk about it in though. I have a feeling that this requires a non-trivial refact to get Python/JS to talk in a different way, no? Just to be clear, I don't see JSON serialization to save things to Plotly's db / AWS instances going away any time soon. But that said, I think you know a lot more than I do on this topic and I'd happily discuss further. Again, maybe best in another thread though? Thanks for the thorough technical discussion! This is great! |
@theengineear you're right, I wasn't entirely ontopic, mentioning one significant element (typed JS arrays in The thought of replacing JSON for database storage didn't occur to me as I only had the Python -> JS direct communication in mind (I assume, perhaps wrongly, that in order to plot something from Python, there's no interim db storage of the data). |
hey all - I'm gonna close this because I'm pretty sure this PR is pretty stale :-/ if anybody wants to take it over then feel free |
@choldgraf thanks for your reminder. There are a variety of things here, which might be why it never got assigned (or simply, limited capacity). To take an inventory:
Where we're at with each is, afaik:
Also, there's a linked issue referred above, the conversation ended here. It helps triage and assignment if issues/PRs are isolated and granular, in the repo where it's likely to need the change, and with an issue/PR title that gives the gist of the contents. Whether it's one of the Plotly employed contributors or community contributors, it's easier to take and clear specific items with minimal offending tests and expectations. |
for sure - I just don't have time to work on it ATM and I'm cleaning out my old PR cruft. That's helpful info if somebody else wants to take it over though! |
@choldgraf JSON serialization slowness aside, we have something exciting in the works for brain volume visualization: http://fhtr.org/gl-volume3d-demo/ Let us know if you have any suggestions for this demo on this based on your experience with pysurfer. This volume viz should land in an official plotly.js release early next year. |
very cool! I love the viz :-) |
see #487