JavaScript vs Python scripts

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

JavaScript vs Python scripts

L1 Bithead

Hi everyone,

 

Lately, I was wondering about Python and JavaScript performance in terms of computational speed and XSOAR resource use. I'd like to work as efficient as possible and that's the reason I'd like to ask for the XSOAR community thoughts.

 

I'm currently working with Python 3.11.9 (main, Aug 2 2024, 14:46:25) [GCC 13.2.1 20240309] (I don't really know what JavaScript version/Node.js version use XSOAR in general).

 

I replicated this video in XSOAR (Python vs JavaScript - side by side comparison - YouTube) and I read some papers which speaks about this theme, and everyone tells that JavaScript is faster than Python by far. However, in my tests, Python demonstrated that is ~ 60% faster than Javascript.

 

What r u thoughts? What programming language the community usually use to? Is there an official post about this?

 

All the best

2 REPLIES 2

Hey there! You can refer to this documentation regarding the python scripting you can use in xsoar. You can use both Javascript and Python but I am not sure we have any performance benchmarks regarding the same. 

 

https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.x/Cortex-XSOAR-Python-Development-Quick-St...

L2 Linker

python will work slower but not because of interpreter but because using docker to execute. I mean any python code will run in docker container and if there is no specific docker containers to reuse in current time it will need some time to spawn one and run the payload.

 

In very general if you have some small code snippet you can write it in JS but otherwise I will prefer python and not because of speed but because it's isolated in container, supports external libs etc.

  • 657 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!