Can someone confirm data is passed to python by copy as opposed to reference?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The incurred runtime from python tool (proportional to size of data being passed) seems to indicate this.
I'm not an expert, can someone tell me why it needs to be passed by copy anyway?
I have a workflow with 20million records. My tests confirm the python tool alone adds 8 minutes of runtime just passing data in and out of the tool without any calulcations.
- Labels:
- Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Have you also tried changing the Python tool from Interactive Mode to Production Mode before running?
https://help.alteryx.com/current/designer/python-tool
"Select the Production button. Use this mode for models in production. In this mode, Designer consolidates all Python cells from the Jupyter Notebook into a single, read only script. Designer passes that script to your Python interpreter.
When you run the workflow, Designer performs these tasks:
- It bypasses the Jupyter shell, then runs the read-only script through a standard Python interpreter.
- It doesn't display errors, warnings, or print statements.
To edit the Production mode script, select Interactive mode, then edit the cells in the Jupyter Notebook. After you complete your edits, select Production mode."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I wasn't aware of that, thanks. It make absolutely 0 performance difference for me, my code is literally just:
Alteryx.read('#1')
Alteryx.write(df,1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It was worth a shot although I think that will make more of a performance difference with a more comprehensive script. I'm not sure on the exact mechanism by which the Python reads the data into the tool but I believe it is loaded in and temporarily leveraged as a yxdb. Historically I believe that the data was read into the tool and temporarily stored as a sqlite file.
