If the difference were small, it would be a negligible variable, unless the data handling is immense, both in number of records and related tables used to personalize emails, cloud pages, etc.
Finally, we show you some numbers. These will not be important if you use little data; because in many cases, and nowadays, when going to smaller niches, this amount of data is limited. But in some of our clients with huge amounts of data, it is a factor to take into account when both languages meet the desired objective.
Should we use one language or another based on its performance?
As we will see, and given the performance differences thailand telegram between one and the other, the answer if you use a lot of data can be YES.
The test performed is very basic but conclusive , we have used typical data tasks to analyze this performance.
A loop with text printing on each iteration
A simple loop, without printing data or doing any other operation
A data retrieval from a Data Extension and its printing in a table (50 rows)
A loop with a GET call to a page (5 requests)
And a test of making 500 inserts in a Data Extension with 6 fields

The results are very striking: the difference is very large in some tasks, mostly to the detriment of SSJS (bad news for those of us who prefer this language) and curiously the biggest difference is a very simple loop to print a text; but in the rest there are also differences, it only wins if it is a loop without text, something that is not very common either (to be honest).
Here is the results table :
EXECUTION TIME COMPARISON IN SECONDS: AMPSCRIPT VERSUS SSJS
Script type Ampscript SSJS Differential (%)
Printing a String in a loop of 5000 iterations 0.016 0.708 4325%
20,000 iteration loop without printing 0.06 0.032 -47%
Lookup and print 50 rows of a Data Extension 0.016 0.422 2538%
HTTP get to a URL in a loop 5 calls 0.158 0.219 39%
500 data inserts in a DE 0.783 0.9496 21%
And here is a table, representing the greater or lesser slowness of one language versus the other.
performance-ampscript-versus-ssjs-marketing-cloud
We hope that this information will shed some light on this. It has helped us to make decisions in each development, because we prioritized SSJS more than we should have and now we will take AMPSCRIPT more into account in certain projects.
If you liked this article, you may also be interested in:
Salesforce Marketing Cloud Development – Ampscript or SSJS?: Intro (Part 1)
Salesforce Marketing Cloud Development: Ampscript or SSJS?: Comparison (Part 2)