• Skip to primary navigation
  • Skip to main content
Alexandre Vazquez
  • Home
  • TIBCO
    • TIBCO BusinessWorks
    • Flogo
    • TIBFAQS
  • Architecture
    • API
    • Security
    • Integration
    • Event Processing
  • Kubernetes
  • Monitoring
    • Observability
    • Prometheus
    • Log Aggregation
      • Loki
  • Service Mesh
    • Istio
  • Helm
  • Editorial
  • About Me

Flogo Performance: How performant can be your services with Flogo? (Flogo vs Python)

Published on 2019-07-01. Last Updated on 2022-09-15 by Alexandre Vazquez

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)
Table Of Contents
  1. Introduction
  2. Scenario
    • Test 1
    • Test 2
  3. Results and Conclusions
    • Test 1
    • Test 2
  4. Conclusions
  5. Resources
    • GitHub – alexandrev/flogo-vs-python-medium

Introduction

In previous posts, we’ve talked a lot about all the capabilities of Flogo and how to do different kinds of things with Flogo, and one message was always underlined there: performance, performance, performance… but how flogo performance is compared with other modern programming languages?

To be able to share some real data the best thing we can do is to do our test. To do our test we’re going to compare our Flogo development versus the same one using Python.

You could ask why we’re comparing Flogo developments and Python developments and the answer is very simple. Python is now one of the most trending languages, recently added as the 3rd top language in the TIOBE Index and the main language when we talked about data science scripting:

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)
Tiobe Index That Shows Python As The 3Rd More Used&Nbsp;Language

Scenario

Test 1

We’d like to test both technologies but also see how they compared with the new reality for microservices and be able to integrate with Cloud Services and we think the best fit for this test will be using Amazon S3 to be able to see how both technologies perform.

So, we’re going to upload files to Amazon S3 and see how both technologies perform. And we select the following tests:

  • File A: small 138 KB. Number of iterations, 1, 10, 50.
  • File B medium 7 MB. Number of iterations 1, 10, 50.
  • File C: big 50MB. Number of iterations 1, 10, 50.

We’re using the following Python script for test the S3 integration:

import boto3
import time
import sys
import psutil
from botocore.exceptions import NoCredentialsError
ACCESS_KEY = 'XXXXXXXXXXXXXXXXX'
SECRET_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXX'
def upload_to_aws(local_file, bucket, s3_file):
       s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,
       aws_secret_access_key=SECRET_KEY)
       try:
           s3.upload_file(local_file, bucket, s3_file)
          print("Upload Successful")
          return True
       except FileNotFoundError:
          print("The file was not found")
          return False
       except NoCredentialsError:
          print("Credentials not available")
          return False
def launch():
    start = time.time()
    for x in range(0, int(sys.argv[1])):
    uploaded = upload_to_aws('D:/Data/Downloads/export.sql', 'testflogovspython', 'export.sql')
    end = time.time()
    print("Time: " +  str(end - start))
launch()

And we’re going to use the following Flogo Application (several flows for each of cases we’d like to check)

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)

Test 2

Now, as this is going to be to build microservices or applications in a cloud world let’s see how both perform doing a simple Hello World REST API. For the python part we’re going to use Flask to create the web service and the following snippet:

from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
    return "Hello World!"
if __name__ == '__main__':
    app.run(debug=True)

NOTE: We keep the debug=True to make it equivalent to the INFO default level system in Flogo Application

And for Flogo a simple REST Hello World like this:

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)
Flogo Hello World Rest&Nbsp;Api

Results and Conclusions

Test 1

We’re getting the following numbers as you can see in the graph below:

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)

Even in this quite simple code sample, the performance of the Flogo application is too incredible to be compared with another well-performed language like Python.

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)

We’re talking like an average of more than 50% faster the Flogo development vs the Python one, and even more when the size of the file is small and more important is how the language and the platforms are handling things because they percentage of time regarding bandwidth is not big enough to make that all the values depend on the connection you have available at that moment.

If we talk about memory consumptions data are pretty much stable for both languages what is a very good sign on how memory is handled for those platforms. But in this battle also Flogo wins because if we use the last one the biggest one, Flogo is stable at 22,7 MB vs 55 MB from Python, also more than 50% better once again.

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)

Test 2

For the REST API service results are pretty similar to the ones from the first TEST, and we’re seeing the following results regarding TPS and Response time:

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)
Transaction Per Seconds Rest Api Python Vs&Nbsp;Flogo
Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)
Response Time Rest Api Python Vs&Nbsp;Flogo

As we can see first of all the response time is always smaller from the Flogo API (and remember that this is a default test, with no special tuning or something similar) and also the response time is performing better in Flogo being able to keep stable almost until 4 threads and then being able to control the increase while Python REST service after 2 threads the response time increase more than twice with each test.

The same thing happens regarding TPS wherein the Flogo case all the values are better than the previous one. Of course, some kind of limit is reached at 8 threads but in the case of Python this root is reached at 2 threads and after that point all the values and worse than the previous one.

Regarding memory, consumption is pretty similar like the previous test both of the solutions keep memory usage quite low and stable. In this case, python is always stable at 20.3 MB and Flogo starts at 15 MB but reaches its peak at 21.8 and then go back to 18.8 MB. So as I said they’re pretty similar regarding memory usage in this test

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)
Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)
Flogo Vs Python Memory Consumption

Conclusions

So, the conclusion is clear, no matter how well you think your logic is executing in Python, you should give it a try to do it using Flogo because, in this time where each MB and each msec counts to make smaller your Infrastructure bill, Flogo is going to be your best tool to squeeze all the power of your infrastructure.

Resources

You can find all the code I’ve used for these tests in the GitHub repository shown below:

Flogo Performance: How Performant Can Be Your Services With Flogo? (Flogo Vs Python)
GitHub – alexandrev/flogo-vs-python-medium
Contribute to alexandrev/flogo-vs-python-medium development by creating an account on GitHub.
If you find this content interesting please think about making a contribution using the button below to keep this content updated and increased!


Related articles:

Tibco Flogo IntroductionTIBCO Flogo Introduction Building Your First Flogo ApplicationBuilding your First Flogo Application Installing Flogo ExtensionsInstalling Flogo Extensions Graphql Support In Flogo EnterpriseGraphQL Support in Flogo Enterprise

Copyright © 2023 · Custom on Genesis Framework · WordPress · Log in