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

more docs #127

Merged
merged 22 commits into from
Sep 15, 2024
Prev Previous commit
Next Next commit
wip
  • Loading branch information
fzumstein committed Sep 13, 2024
commit e2d08e48c1cd5a84e84547b58066bd96896b6c40
18 changes: 14 additions & 4 deletions docs/custom_scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,22 @@ async function helloRibbon(event) {
Office.actions.associate("hello-ribbon", helloRibbon);
```

## VBA, Office Scripts, and Google Apps Script clients
## Office Scripts and Google Apps Script clients

If you want to call a custom script from VBA, Office Scripts, or Google Apps Script, you will need to use the runPython function with the following endpoint:
If you want to call a custom script from Office Scripts or Google Apps Script, you will need to use the `runPython` function with the following endpoint:

```python
runPython("https://127.0.0.1:8000/xlwings/custom-scripts-call/hello_world")
```js
runPython("https://127.0.0.1:8000/xlwings/custom-scripts-call/hello_world");
```

Make sure to replace `hello_world` with the name of your custom script!

## VBA

If you want to call a custom script from VBA, you will need to use the `RunRemotePython` function with the following endpoint:

```vb.net
RunRemotePython("https://127.0.0.1:8000/xlwings/custom-scripts-call/hello_world")
```

Make sure to replace `hello_world` with the name of your custom script!
Expand Down
Binary file added docs/images/performance_array_function.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/performance_individual_function.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions docs/performance.md
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
# Performance

## Custom Scripts

By default, custom scripts send the content of the entire workbook to the backend. Most of the time, this is not required, so you can include or exclude specific sheets via the `include` and `exclude` parameters, see [](client_configuration.md).

## Custom Functions

An easy way to make custom functions perform better is to reduce their number. And this can often be achieved by using dynamic arrays in place of many single-cell functions. Consider the following example:

```python
import numpy as np
from xlwings.server import func, arg


@func
def mysum(x, y, z):
return x + y + z


@func
@arg("x", np.array, ndim=2)
@arg("y", np.array)
def myarraysum(x, y, z):
return x + y + z
```

The first example results in 100 individual function calls on the screenshot:

```{figure} ./images/performance_individual_function.png

```

The second example results in just a single function call:

```{figure} ./images/performance_array_function.png

```