Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Questions and tips for API script performance

Hi all, Is there a sense as to how much various API scripts affect the overall performance of a campaign? ie, as I add various event handler functions, am I appreciably slowing down the performance of my campaign? Are there tips and best practices for reducing this overhead, or is it not something that I should be too worried about? I do notice that my campaign seems to slow down after a lot of API work, but it seems to go away once I restart the browser session.
1421960697
The Aaron
Pro
API Scripter
From my experience, I would say "It depends." There are a few things to consider. API scripts run on their own server, away from your Campaign's general operations. As best I can tell, the API interacts with the Campaign via asynchronous message passing. In general, an API script should have no effect on the operational speed of your campaign except when the Campaign is parsing messages from it. For example, if the API server is caught in an infinite loop, your Campaign should not be effected. However, if your API is sending copious messages to the Campaign and it must respond to them, such as an infinite loop of sending chat messages (Pro Tip: don't sendChat() whenever you get a chat message.. bad idea...), thing can get pretty slow. The practical upshot of all that: Well written scripts should have a minimal effect on the speed of your campaign Poorly written scripts might cause some slow downs.