Back

[SOLVED] Function : One language or multiple language ?

  • 0
  • Self Hosted
Mickaël LT
7 Mar, 2023, 11:00

Hi, Is there a good practice for writing function ? It's better to write all ours functions in dart or node or php ? Or it have no impact for performance to have multiple language ?

TL;DR
There is no performance impact on using different languages for different functions. It might be harder to onboard, but there could be benefits with different libraries available in different languages. In terms of performance, all runtimes can execute hello world code in about 1-10ms, with the fastest being Dart, Node, and Swift, and the slowest being PHP and Python. However, there can be differences in execution time for specific tasks, such as connecting to a MySQL server. This depends on the library coverage in different runtimes. In terms of best practice, it's subjective, but using multiple languages is fine for performance. Solution:
Meldiron
7 Mar, 2023, 12:03

Hey there 👋 I would say there is no performance impact on using different languages for different function. Might be harder to onboard, but might be beneficial thanks to different libraries availability in different languages.

Regarding performance, all runtimes can execute hello world code in ~1-10ms. Fastest being Dart/Node/Swift, slowest being PHP/Python. Tho it's difference of 9ms so I wouldn't worry too much.

Well but for example, if you connect to mySQL server in Node, first execution (handshake) takes up to 200ms. While same logic in PHP can execute in <50ms. This again depends on library coverage in different runtimes

Meldiron
7 Mar, 2023, 12:04
Mickaël LT
8 Mar, 2023, 09:59

Thanks for the complete answer 👌

Meldiron
8 Mar, 2023, 10:11

[SOLVED] Function : One language or multiple language ?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more