Django (Python) vs Go (Golang): Performance (Latency - Throughput - Saturation - Availability)

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ม.ค. 2025

ความคิดเห็น • 414

  • @AntonPutra
    @AntonPutra  3 หลายเดือนก่อน +11

    🔴 To support my channel, I'd like to offer Mentorship/On-the-Job Support/Consulting (me@antonputra.com)

    • @chetana9802
      @chetana9802 3 หลายเดือนก่อน +3

      Hey
      django is old, try fastapi or sanic

    • @KozakZabava
      @KozakZabava 3 หลายเดือนก่อน +1

      Nest.js vs Rocket(rust)??

    • @artemxyi
      @artemxyi 3 หลายเดือนก่อน +1

      Please try Ntex(Rust) vs Axum vs Tokio vs Actix vs Drogon(c++)

    • @EduardoSantos-wg8or
      @EduardoSantos-wg8or 3 หลายเดือนก่อน

      I'm curious about frameworks that I believe are a little less popular, e.g. phalcon (php) or drogon (c++)

    • @Mr.BinarySniper
      @Mr.BinarySniper 3 หลายเดือนก่อน +3

      Bun vs Deno vs Nodejs please please please.

  • @speirnhujin8940
    @speirnhujin8940 3 หลายเดือนก่อน +277

    Comparison between FastAPI and Go stdlib seems much more appropriate, FastAPI focuses on speed and has a lot less "bloat" than Django

    • @oktay9784
      @oktay9784 3 หลายเดือนก่อน +35

      There is not much performance difference between Django and FastAPI. Because they are both Python frameworks. That's why they are both very slow.
      If you think FastAPI can compete with Go stdlib, you can take a look at TechEmpower benchmarks.

    • @GeoGuyz
      @GeoGuyz 3 หลายเดือนก่อน

      @@oktay9784 even if it does go still has fiber

    • @sargentomili
      @sargentomili 3 หลายเดือนก่อน +24

      @@oktay9784 Fasta Api relay on Pydantic (Rust) and many C librarys so i am not so sure.

    • @hermes6910
      @hermes6910 3 หลายเดือนก่อน

      ​@@oktay9784 I'm not a pytonista but I have a lot of doubts about a full framework like Django being as lightweight as something like FastAPI.
      And from FastAPI themselves on their homepage says: ‘The main features are: Fast: Very high performance, on par with NodeJS and Go (thanks to Starlette and Pydantic).’
      This doesn't mean that FastAPI will achieve the same results as Go despite what it says.
      But since you're comparing a very fast language (Go), you have to choose the fatest library/framework for something as slow as Python.

    • @deez_dev
      @deez_dev 3 หลายเดือนก่อน +18

      I was going to say that too :)
      FastAPI vs stdlib would be more interesting for sure

  • @silthstraider6542
    @silthstraider6542 3 หลายเดือนก่อน +160

    I really want to see Django vs Flask vs FastAPI video

    • @dupdrop
      @dupdrop 3 หลายเดือนก่อน +23

      Racing snails against each other is at least fair... ;)
      Also vs Litestar

    • @silthstraider6542
      @silthstraider6542 3 หลายเดือนก่อน +1

      @@dupdrop 😁

    • @thelearningmachine_
      @thelearningmachine_ 3 หลายเดือนก่อน +2

      Flask is synchronous, it can only process 1 request per turn, until accepts the next one. FastAPI humiliate Flask in a racing of snails :D

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +11

      noted! I'll do it in the near future

    • @MrVajcakaty
      @MrVajcakaty 3 หลายเดือนก่อน +1

      @@thelearningmachine_ Not true, wrap/place gunicorn in front of Flask and it will dominate.

  • @likwidsage
    @likwidsage 3 หลายเดือนก่อน +53

    Great test but nothing surprising. Go is known to walk that line between ease of use and performance. Python more towards ease of use, with less performance. and Rust more towards performance but is harder to use.

    • @AntowaKartowa
      @AntowaKartowa 3 หลายเดือนก่อน +1

      On a course about algorithms lecturer was writing code mainly on Java, but also shows examples on Python and JavaScript. Java has showed much bigger performance than Python in every test, so I concluded that Python is relatively slow language.
      Recently I've read that Go is very lightweight and fast and that's why it is widely used in microservices.
      It made the wrong perception that Python should be slower than Go.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +14

      the question wasn’t whether Python is slower, but by how much it is slower 😊

    • @everyhandletaken
      @everyhandletaken 3 หลายเดือนก่อน +5

      For sure, but the best part about Go is that it is only marginally more complex than Python, yet much better performance

    • @haploid2k
      @haploid2k 3 หลายเดือนก่อน +5

      There is nothing "easy" about Python. If you hate yourself that much, by all means, use a language where whitespace is syntax. But if you value your sanity, choose something less schizophrenic, with proper block definition syntax and a static type checker.

    • @SAsquirtle
      @SAsquirtle 3 หลายเดือนก่อน

      @@haploid2k pathetic skill issue, use an IDE and type hints with mypy + ruff

  • @dragonvslvr
    @dragonvslvr 3 หลายเดือนก่อน +15

    Very cool! I recently converted a python pipeline to rust and was shocked by the performance improvements 40s -> sub 1second. If you want I might be able to help convert this to something like fastapi since it’s very popular. Might be beneficial for everyone to see

    • @artemxyi
      @artemxyi 3 หลายเดือนก่อน +1

      Create the fastest python framework?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thanks!

  • @mr.nobody4494
    @mr.nobody4494 3 หลายเดือนก่อน +15

    ☝ Please, C# with .NET 9 vs (Java with Spring Boot and Python with FastAPI), all of these using PostgreSQL. Thanks in advance! 🙌

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +7

      ok, i'll come back to c# and .net soon

  • @hdeolivera
    @hdeolivera 3 หลายเดือนก่อน +49

    Great work! Bun vs Go, please 🙏

    • @PanicAtProduction
      @PanicAtProduction 3 หลายเดือนก่อน +4

      Yes. This please

    • @Serizon_
      @Serizon_ 3 หลายเดือนก่อน +1

      @@PanicAtProduction Bun will lose if I remember correctly , by watching a video of some guy who converted his code from bun next to golang for static pages I guess
      I am also interested in this though since bun actually has bs benchmarks on its website (its comparing 17x faster for react , for a simple hello world which is pretty stupid imo)
      I would like to see some practical examples like how Anton does
      Please anton , lets see bun vs golang.

    • @papa_ethan
      @papa_ethan 3 หลายเดือนก่อน

      @@Serizon_ Nothing could match go other than C/C++/Rust/Zed/Object-C even C#.Net and Java will lose

    • @jlucaso
      @jlucaso 3 หลายเดือนก่อน +6

      Up. bun (bun.serve) bun (elysia)

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +3

      ok!

  • @УважаемыйЧеловек-л4с
    @УважаемыйЧеловек-л4с 3 หลายเดือนก่อน +14

    Every Django task is blocking, so there is big latency when working with multiple users. There is obvious optimizations for Django app - use async views, async calls to dbs, async middleware + some asgi server (like uvicorn). For further improvement you can use C-written "NGINX Unit" as WSGI/ASGI server instead of Python-written Gunicorn/Uvicorn.
    And looks like there is unnecessary middlewares, too.
    I hope someone else can make pull request because I used Django only a couple of times (not a big expert, esp. talking about performance)
    Would like to see FastAPI vs Django vs Go stdlib vs some js backend (maybe both Node and Bun) in the next video.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +4

      thanks! i'll try async views in the future

    • @Vismund2
      @Vismund2 3 หลายเดือนก่อน

      @@AntonPutra Configuring gunicorn to use gevent workers should be quicker to set up. But I'd still be very interested in comparing it with actual async python functions.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +3

      @@Vismund2 no, i'll try async

    • @shulehr
      @shulehr 3 หลายเดือนก่อน

      @@AntonPutra i cant wait to see that one :)

    • @王俊杰-n5y
      @王俊杰-n5y 17 วันที่ผ่านมา

      a nice suggestion!Because of GIL's existence,The multithread-model can't make use of multi-core cpu.Please use multiprocess and other server software like gunicorn.Then,set up the number of wokers(how many process to handle request)

  • @adrianbool4568
    @adrianbool4568 3 หลายเดือนก่อน +5

    On your question about why is Python transmitting so much more data across the network. I suspect that is due to Gunicon not supporting HTTP KeepAlive on sync requests and therefore you're seeing the TCP setup & close traffic for each any every request to the Python server. Go's ServeMux does seem to support HTTP Keepalive; hence its comparitively lower traffic levels. I guess an async Django instance, supporting HTTP KeepAlive, would be interesting - if possible!

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +2

      Thanks! I'll look into HTTP KeepAlive and try async implementation as well

  • @mfc1190
    @mfc1190 3 หลายเดือนก่อน +15

    Awesome video - quick nit: in the CPU Throttling, you have zig instead of go. This was really insightful!

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +2

      thanks, it just a label from the previous benchmark it is actually golang

    • @mfc1190
      @mfc1190 3 หลายเดือนก่อน

      @@AntonPutra yeah no worries, just figured I would give you a heads up if this is attached to a repo

  • @aryindra2931
    @aryindra2931 หลายเดือนก่อน +1

    Go may be fast but there is a python framework that uses c++, which far surpasses go fiber, gin and stdl namely socketify

  • @Jonathanlouisa
    @Jonathanlouisa 3 หลายเดือนก่อน +13

    php/Laravel vs Bun vs Python pls

    • @Dipj01
      @Dipj01 3 หลายเดือนก่อน +1

      Yeah +1 for laravel

    • @ORiastanjung
      @ORiastanjung 3 หลายเดือนก่อน +1

      yep im curious on these laravel/php also

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      ok, soon!

    • @Smaylik03
      @Smaylik03 หลายเดือนก่อน

      @@AntonPutra Make sure to use Laravel Octane (with Swoole or FrankenPHP), not php-fpm

  • @brandonkauffman7256
    @brandonkauffman7256 3 หลายเดือนก่อน +5

    Looks like Go's postgres connection limit is reached with 4 connections causing the timeouts.

    • @brandonkauffman7256
      @brandonkauffman7256 3 หลายเดือนก่อน +4

      I made a PR to allow a higher max connection limit

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      thank you! merged and i'll be using the same 20 for other languages as well

  • @mallickpriyanshu
    @mallickpriyanshu 3 หลายเดือนก่อน +5

    Would love to see a Nodejs (Express) vs Python (FastAPI)

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      ok noted!

  • @christiangualteros36
    @christiangualteros36 3 หลายเดือนก่อน +1

    Thank you. Great job. These benchmarks are so good and a great idea for the people who work in production.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thanks!!

  • @abdussametkaci5795
    @abdussametkaci5795 3 หลายเดือนก่อน +8

    Nice content, please Spring Boot (Native) vs Go 🙏

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +5

      thanks, will do soon!

  • @nightmarenova6748
    @nightmarenova6748 3 หลายเดือนก่อน +1

    This is so interesting! As someone who likes to self-host stuff i have an instance of Authentik(an Auth provider for your self-hosted services made largely with Python and Typescript ) where for all its services like the agent and the service itself it consumes around 1 to 1.2gb of ram! Which is quite insane . As soon as i saw the graphs in this video it reminded me of Authentik!
    Thanks for yet another amazing video btw! Keep up the great work!

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      haha, thanks!

  • @antonmarini3662
    @antonmarini3662 3 หลายเดือนก่อน +3

    A few questions which might help with Python performance that I didn't see addressed
    * what version of python are you using?
    * can you test with async views in Django?
    I'd never expect python to be nearly as performant but im curious if the latest GIL updates in 3.11, 3.12 and 3.13 along with Django's Async views help with the dismal performance?
    Thanks from a fellow Anton :)

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      Thanks! :) I'm using 3.12.6 - github.com/antonputra/tutorials/blob/main/lessons/209/mydjango/Dockerfile#L12C13-L12C19
      I'll try async views next time

  • @BeeBeeEight
    @BeeBeeEight 3 หลายเดือนก่อน +1

    I find yr videos really insightful. U are probably the only person and channel that really demonstrates that the choice of programming language is a very important factor in software/web development. Many people are guilty of burying this in the hopes that their favorite stack will not be exposed for the CPU vampires that they are.
    At this point it seems that Go is the fastest GCPL for pretty much anything memory safe while Rust is the fastest non-GCPL for the same. 😅

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      Well, I'm a DevOps engineer, not a programmer, so I don't have any bias😊

  • @konoko-o3o
    @konoko-o3o 3 หลายเดือนก่อน +3

    Very good video as always.
    But I think that results are expected, will be interesting compare between Python frameworks popular for backend: Django Rest Framework, FastAPI and Flask.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      Thanks, yes, but I didn't think that it could only process 2.5k requests.

  • @FAELP22
    @FAELP22 3 หลายเดือนก่อน +2

    Very good, thank you. Could you teach me how to configure Prometheus and Grana in the EKS cluster? And how to create this dashboard?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +2

      sure i'll come up with some new tutorials how to

  • @milacc0000
    @milacc0000 2 หลายเดือนก่อน +2

    How about compare python on JIT (PyPy) and others? AFAIK with JIT, python caches functions so maybe python can handle more requests without reaching CPU limit so fast

    • @AntonPutra
      @AntonPutra  2 หลายเดือนก่อน +1

      ok, i'll consider it

  • @MD.NazrulIslamKhan-b8j
    @MD.NazrulIslamKhan-b8j 3 หลายเดือนก่อน +2

    @AntonPutra Please add `blacksheep` python framework in your next test which is well known for it's performance

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      sure, i'll take a look

  • @chu121su12
    @chu121su12 3 หลายเดือนก่อน +4

    👋 requesting similar benchmark for java (especially with v22 vs v23 which had new gc) vs go/rust. thanks in advance

    • @galiKZ0
      @galiKZ0 3 หลายเดือนก่อน

      Yes! Should be interesting!

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +2

      noted! i'll come back to java and c# soon

  • @099watcher
    @099watcher 3 หลายเดือนก่อน +2

    Thank you, I was really looking forward to this.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      my pleasure

  • @Mr.BinarySniper
    @Mr.BinarySniper 3 หลายเดือนก่อน +10

    Please, we want a test between javascript runtimes. Bun vs Nodejs vs Deno. Please please.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +4

      yes, next node vs go, right after i'll test these three i promise

    • @DavidSmith-ef4eh
      @DavidSmith-ef4eh 3 หลายเดือนก่อน

      I assume bun has a small edge over node and node has a small edge over deno. deno being the slowest of them all, but not by mutch. maybe 5% slower than bun.

    • @Mr.BinarySniper
      @Mr.BinarySniper 3 หลายเดือนก่อน

      @@DavidSmith-ef4eh yeah. thats all we wanted to see.

    • @ashwinsnmv
      @ashwinsnmv 3 หลายเดือนก่อน +1

      ​@@DavidSmith-ef4ehactually node is slower than Deno in many benchmarks. Bun is fastest because it uses c based library with js bindings.

    • @musashigarami
      @musashigarami 3 หลายเดือนก่อน

      @@AntonPutra This is awesome! Thanks

  • @Fenospro
    @Fenospro 3 หลายเดือนก่อน +2

    I would like to see one with NodeJs fastify vs Golang

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      node is next

  • @dmitrydudalov8886
    @dmitrydudalov8886 3 หลายเดือนก่อน +2

    try pypy interprieter. i had dramatical improve performance just change and have JIT

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thanks! i'll try

  • @muharief3885
    @muharief3885 3 หลายเดือนก่อน +7

    Django is a framework, and you've compared with stdlib non framework compiled go? what a on fair comparison. It was apple and orange.
    When go is async from the start, that huge django is threaded sync framework dude.
    Whats the point comparing compiled language to interpreted language when simple hello world is enough to justify compiled lang supremacy.
    The closest thing you can do is comparing go with python fastapi/falcon + pypy which is far superior to django in term of performance.
    Django is big because you have everything included to develop fast business application.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +3

      I know, I have a lot of experience running Django in production at my company. I know it's slow, but I've received several requests to demonstrate just how slow it is.

    • @plathardstuck28
      @plathardstuck28 3 หลายเดือนก่อน +2

      @@AntonPutra now you need to demostrate how slow you will write in Go all built-in systems, that django has out-of-box. Templating, translation, timezones, auth, sessions, ORM (with very complicated queries support), CORS middleware, clickjacking middleware, password hashing... list goes on. Plus there are TONS of working solutions, that you can use for your applications in notime (DRF, Djoser, Django-model-translation etc.). It is slow. But not "just slow for nothing" - that bunch of tools comes at price.

  • @mukundjajadiya
    @mukundjajadiya 3 หลายเดือนก่อน +2

    Hi,
    When you will bring bun vs nodejs in typescript. Excited to watch it

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      node vs go next, then all bun

  • @mukundjajadiya
    @mukundjajadiya 3 หลายเดือนก่อน +2

    In cpu throtling graph you forgot to rename as go it's show zig from previous test. Just try to grabe your attention 😊

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      haha, i know

  • @ZodakZach
    @ZodakZach 3 หลายเดือนก่อน +1

    so now that u can make websites with just go stdlib i wonder if there are any differences in performance when using something like echo

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      I haven't tested Echo yet, but those web frameworks have useful middleware, logging, rate limiting, etc.

  • @MrQsam
    @MrQsam 3 หลายเดือนก่อน +1

    Pretty useful stuff, as always. I would love to see a comparison between Python FastAPI and frameworks from other languages.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      thank you, will do fastapi soon

  • @mirkamolmirobidov1991
    @mirkamolmirobidov1991 3 หลายเดือนก่อน +1

    Awesome test format. I want to see c++ userver vs rust benchmark it will be interesting to see cpu and ram usage also latency

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thank you! yes i'll do cpp soon

  • @alexreustle
    @alexreustle 3 หลายเดือนก่อน +1

    I’d like to see a benchmark test of c++ Drogon framework vs similar competitors, like actix in rust

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      will do!

    • @alexreustle
      @alexreustle 3 หลายเดือนก่อน

      @@AntonPutra you’re very kind. Thank you

  • @jimzordstam6338
    @jimzordstam6338 3 หลายเดือนก่อน

    Amazing and professional video as always, I actually requested this one in the previous (Rust vs Zig) so a million thanks!
    Personally, I used Bun.js + Elysia a week ago and had a great DX. So having a Benchmark that answers which JS web framework is the fastest would be awesome. For Node.js I would choose the Hyper express or Hono, Elysia for Bun and I have no clue about deno.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      Thank you! I’m actually planning to do Node next

  • @LinuxGamerYT
    @LinuxGamerYT 3 หลายเดือนก่อน +1

    Could you test the Emmette framework in Python? It is written in Rust and uses asynchronous Python.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      ok, just added to my list

  • @Hientm
    @Hientm 2 หลายเดือนก่อน +1

    Ruby on rails vs java. Can you check perfẻomance?

    • @AntonPutra
      @AntonPutra  2 หลายเดือนก่อน

      yes will do!

  • @Flipidiflop
    @Flipidiflop 3 หลายเดือนก่อน +1

    I don't understand the caching that happens for go
    How it is setup? Is it a default behavior? Like why is it doing it just when cpu is a 100%?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      Yes, since I use the standard library, it doesn't have any rate-limiting capabilities, so it accepts each request. Eventually, all those requests fill up the memory, and it crashes. That's why you might choose a framework or at least implement it yourself.

  • @billn98
    @billn98 3 หลายเดือนก่อน +1

    Nice video 👍. Can you do Dart vs Go next (Serverpod vs Gin, or both stdlib)?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      will do soon

  • @MaksimG73577
    @MaksimG73577 2 หลายเดือนก่อน +1

    Сравнение Python FastAPI и Golang stdlib было более корректным. Спасибо за контент.

    • @AntonPutra
      @AntonPutra  2 หลายเดือนก่อน

      horosho, spasibo!

  • @RobertoMaurizzi
    @RobertoMaurizzi 3 หลายเดือนก่อน

    If I understand correctly, Go does automatic parallel scheduling of the code that manages the requests.
    In Django you should use async view functions and run using the asgi interface provided by Channels.
    It'll still be way slower, but better than what you got. Also, you should run it using an application server like uwsgi (I can't see how you ran it, I'm on a phone and it's too small/fast 😅)

    • @RobertoMaurizzi
      @RobertoMaurizzi 3 หลายเดือนก่อน

      ... and youtube won't allow me to comment about how to use uvicorn to run the project using async... It's in the official docs 🙂
      I'm curios to see how much things change with async views.

  • @wolfeygamedev1688
    @wolfeygamedev1688 2 หลายเดือนก่อน

    As someone who uses FastAPI professionally as a data engineer, and Rust as a hobbyist.
    Python itself is slow as a slug, but ive found that through just using polars for all of the actual data manipulation. and python just for basic control flow / config makes things much better.
    My super brilliant coworkers actually do the data manip inside of pure python, and yes, that is just abysmally slow.
    In my experience the average python dev who only codes for work, and doesnt know any compiled langs, are often oblivious as to what is going on under the hood, and thereby unaware of the memory and compute messes they create.

  • @andresaguilar3055
    @andresaguilar3055 3 หลายเดือนก่อน

    Hey, I’ve been watching your videos for a while now. I really appreciate this kind of content. Especially for a person obsessed with perfomance like me.
    I would really like to see a comparison between databases perfomance. Especially postgresql vs mysql. Thank you btw.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      Thank you! I’ve been thinking about those two for a while. I'll get to them soon.

  • @AGAU1022
    @AGAU1022 3 หลายเดือนก่อน

    Could you add some measure of cold start performance? Or did I miss it?

  • @ooguro8513
    @ooguro8513 3 หลายเดือนก่อน +1

    The comparison is not valid. Django has a significant number of default middleware, which means that the request must go through several processes before reaching the view function.

    • @ooguro8513
      @ooguro8513 3 หลายเดือนก่อน

      One thing to keep in mind is that it is not appropriate to compare programming languages or frameworks directly, as each has its own advantages and disadvantages.

    • @ooguro8513
      @ooguro8513 3 หลายเดือนก่อน

      The success of a project does not solely depend on the tools used, but rather on the intellectual capabilities and expertise of the individuals involved.

    • @ooguro8513
      @ooguro8513 3 หลายเดือนก่อน

      For instance, Instagram was developed using Python Django.
      Do you believe it is slow?
      Of course not, correct?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      At my company, we've been running Django in production for at least 4 years. Yes, it's a totally production-ready framework, but it's just slow. I have a lot of experience running Django in production under heavy load :)

  • @DavidSmith-ef4eh
    @DavidSmith-ef4eh 3 หลายเดือนก่อน +20

    doesn't sound like a fair benchmark. it's like a race between Hussain Bolt and Joe Biden.

    • @nanonkay5669
      @nanonkay5669 3 หลายเดือนก่อน +1

      What's not fair about the comparison? How he conducted it or the languages used?

    • @DavidSmith-ef4eh
      @DavidSmith-ef4eh 3 หลายเดือนก่อน

      @@nanonkay5669 python is know to be one of the slowest languages, while go is on top of all benchmarsk... it's too much of a gap to even compare them.

    • @nanonkay5669
      @nanonkay5669 3 หลายเดือนก่อน +6

      @@DavidSmith-ef4eh people understand that and we all heard it, but some want to see it and also quantified. It doesn't make the benchmarking unfair

    • @statuschannel8572
      @statuschannel8572 3 หลายเดือนก่อน +5

      @@DavidSmith-ef4eh you'd be suprised how many people believe Python is faster than others. A solution architect even told me python is faster than what he uses everyday( C# )

    • @roccociccone597
      @roccociccone597 3 หลายเดือนก่อน

      @@DavidSmith-ef4eh lots of people use Django and Python for server side code.

  • @ORiastanjung
    @ORiastanjung 3 หลายเดือนก่อน +1

    Love the way you explain it dude, it really tell us many information from it.
    I really curious on Laravel PHP vs NodeJS
    Would you mind try it also? since those three were very popular in my city currently

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      thank you! yes node is the next

  • @friedrichdergroe9664
    @friedrichdergroe9664 3 หลายเดือนก่อน

    I would love to see this benchmark between Go and Elixir. They are more similar as both are designed to handle high concurrency.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      ok, noted!

  • @HarshRanjan-z4b
    @HarshRanjan-z4b 3 หลายเดือนก่อน

    Could you do some kind of benchmark on number of active connections and how well actix-web handles it as compared to something in erlang? I would love to see why WhatsApp decided to go with erlang (even though Rust probably wasn't too mature/did not exist?) over the more mainstream tools, maybe even C++. C++ also has a relatively less known web framework in the form of drogon.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      Yes, I keep optimizing the DB setup. I’ve now set the pool to 20 connections and some timeouts, but scaling the connection pool is usually handled by the library itself. I have metrics from the database to visualize them in Grafana.

  • @richardnpaul_mob
    @richardnpaul_mob 2 หลายเดือนก่อน +1

    Async would be good but I'm a little concerned by the k8s and gunicorn configuration. Actually the Docker file too. You have 3 Gunicorn workers which can each use up to 1CPU, you have CPU limited to 2 which can mean that k8s can start starving the workers of CPU time. This is a common issue with K8s and why for things like Web apps you never want to apply CPU limits (I understand why you're doing it here as you're using machines that are far in excess of 2 CPU cores and want to limit their CPU access). It's also why you probably see some of the weird behaviour that you do because I've seen similar with production workloads where CPU limits are in place in k8s deployments. You probably don't want to turn off the python file caching in the Dockerfile for the final stage image as this can affect performance; I believe.

    • @AntonPutra
      @AntonPutra  2 หลายเดือนก่อน +1

      ok, thanks for the feedback. it's more of an art to optimize applications in kubernetes, but i get your point. i'll spend a couple of hours next time tweaking workers and CPU shares in k8s 😊

    • @richardnpaul_mob
      @richardnpaul_mob 2 หลายเดือนก่อน

      @AntonPutra I think with the video you dropped today you used instances with 2 cores, so this is what I would do, use 2 core VMs and don't use limits and you can leave the remaining configuration as is so long as Go has access to using both cores as well. They won't have access to all of both CPU cores because of requests on things like any daemonsets but that should be the same for both instances.

  • @musashigarami
    @musashigarami 3 หลายเดือนก่อน +1

    I'm scared to see node js next XD, node js vs Go would be a good one.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      😊

  • @madsemy55what604
    @madsemy55what604 2 หลายเดือนก่อน

    What's the difference between Golang devices endpoint in this video vs the same endpoint in video vs rust? In vs rust video, go lang reached 14k req/s, here it got to 67k req/s. The only difference from pods is memory.

    • @AntonPutra
      @AntonPutra  2 หลายเดือนก่อน

      I improve the infrastructure and test design with each new video and the advice I get. In the previous video with Rust, the socket count was the problem that limited rps

  • @Error_00101
    @Error_00101 3 หลายเดือนก่อน

    What type of compression with what strength is used if any?
    -> that could explain the more data recived

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      I didn't enable any compression middleware for Django and also used just the default Go stdlib without compression or any proxies like Nginx.
      github.com/antonputra/tutorials/blob/main/lessons/209/mydjango/mydjango/settings.py#L23-L33

  • @abdulawal604
    @abdulawal604 3 หลายเดือนก่อน +1

    Why not MySQL vs PgSql vs Sqlite(WAL mode)

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      yes i was thinking about db comparisons, i may do them in near future as well kafka vs rabbit etc

  • @VinayGoudtallapalli
    @VinayGoudtallapalli 3 หลายเดือนก่อน +10

    Whoa..Not even a competition from Go's side

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      well, I need a rate-limiting library to avoid oomkills

    • @MMEEEish
      @MMEEEish 3 หลายเดือนก่อน

      The problem is in Django, and not Python. fastapi or sanic will show way better results @AntonPutra

  • @hectors.1644
    @hectors.1644 3 หลายเดือนก่อน +1

    great content, Nice thumb by the way!

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thank you!

  • @mmadevgame
    @mmadevgame 27 วันที่ผ่านมา

    Can you also do some tests with PHP vs some languages like go, python. PHP gets some insane performance updates I wonder how much faster it is than python

  • @AlexanderBorshak
    @AlexanderBorshak 3 หลายเดือนก่อน +1

    Like for the video; but what do these huge logos of Python and Go mean? It would be better to have a legend, that shows which color belongs to which language.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      I have it in the actual test, you can skip it and have a timestamp in the description.

    • @AlexanderBorshak
      @AlexanderBorshak 3 หลายเดือนก่อน

      ​@@AntonPutra I saw that later in the video, thank you. But still wanders - what do the huge logos of Python on the left side and Go on the right side on the charts mean?..

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      @@AlexanderBorshak nothing really, i don't have a good explanation :)

  • @liorbm5779
    @liorbm5779 3 หลายเดือนก่อน

    Does the GO framework, offer as much as Django offer?
    Also, GO is compiled and it's a language, Django is a framework of interperter language.
    If python will have compiler the differences will be small.
    Not a good comparison, sorry.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +2

      I know, I just received multiple requests to compare Django, and I personally have a lot of experience running Django in production at my company. It is slow but hard to migrate from.

    • @liorbm5779
      @liorbm5779 3 หลายเดือนก่อน

      @@AntonPutra
      Honestly, I will compare apple to apple.
      Let's say Express(or similar) to FastAPI (with and without some JIT for python)
      Anyway, thanks for your effort 😊

  • @LiveType
    @LiveType 3 หลายเดือนก่อน

    "Simple" improvement for the django app I saw is to switch to async everything. This does increase the complexity of the project (and debugging) but should increase throughput a meaningful amount.
    For the go db connection, I did see that the maxConnections was increased to 20 so I suppose that's a fair place to start. I would say increase both the python and go to the max allowed of 100 connections for a saturation test.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      thanks, i'll try async views next time and set poll connections to 20 for both

  • @bozhidaratanasov7800
    @bozhidaratanasov7800 3 หลายเดือนก่อน

    Why do you deploy each test in a separate EKS?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      It's very expensive to keep it around

  • @thewalkthroughmaking
    @thewalkthroughmaking 3 หลายเดือนก่อน

    Hey! Love your videos! Can you do an updated comparission between Istio and Linkerd2? But now using Istio's ambient mode (as oposed to their traditional sidecar mode) They claim that is much less resourse intensive, easier to manage and production ready

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      Yes, but probably Istio (sidecarless) with Cilium.

  • @j-p-d-e-v
    @j-p-d-e-v 3 หลายเดือนก่อน

    Great content!
    This is one of the reason Im refactoring from python(django) to rust(actix) in one of my apps at work. And uwsgi is a nightmare to configure. Though Django is still my goto web framework for doing MVP apps.

    • @antonmarini3662
      @antonmarini3662 3 หลายเดือนก่อน

      I'd be curious how much of the Django ecosystem has equivalent plugins on other platforms. Part of the draw of Django is how full featured the ecosystem is.

    • @j-p-d-e-v
      @j-p-d-e-v 3 หลายเดือนก่อน

      ​@@antonmarini3662 Agree with this, actually in my case I build it from scratch or use a similar library then just add those missing features.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      It's easy to develop with, but hard to migrate from. We've been running Django for multiple years already, and they just keep adding more features.

  • @midgardresident
    @midgardresident 2 หลายเดือนก่อน +1

    Please compare PHP vs Python vs Node vs Go

    • @AntonPutra
      @AntonPutra  2 หลายเดือนก่อน

      will do soon

  • @f4z0
    @f4z0 3 หลายเดือนก่อน

    I'd really like to see how FastAPI behaves

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      ok i'll do FastAPI soon

  • @muray82
    @muray82 3 หลายเดือนก่อน

    You should compare python to C# If I'm not mistaken the results are almost same?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      😊

  • @farhanaliqureshi3908
    @farhanaliqureshi3908 3 หลายเดือนก่อน

    There is no comparison. It looks like Python tanked both tests. In Test-1, Go was handling ~60k req/s while Python was handling ~2k req/s. For a fair comparison, both should be serving similar number of requests per second. In Test-2, Python app just crashed under load.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      yes, i'll try async views next time

  • @aaliboyev
    @aaliboyev 3 หลายเดือนก่อน +1

    You made me think on switching to go api backend

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      no so fast, i want to try async views as well, they say it's much faster

  • @AntonPutra
    @AntonPutra  หลายเดือนก่อน

    🍿 Benchmarks: th-cam.com/play/PLiMWaCMwGJXmcDLvMQeORJ-j_jayKaLVn.html&si=p-UOaVM_6_SFx52H

  • @pkucmus
    @pkucmus 3 หลายเดือนก่อน

    Hi, first time here, I would love to learn how to make such benchmarks. Would also like to see something more modern for Python like FastAPI or Starlette (ASGI) VS Fastify TypeScript

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      Ok, noted! I'll make some tutorials on monitoring in the near future as well

  • @AGAU1022
    @AGAU1022 3 หลายเดือนก่อน

    Thanks for these. I would love to see Elysia vs Fresh (Deno)

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      no problem, will test Elysia soon

  • @weiSane
    @weiSane 3 หลายเดือนก่อน +2

    Why is the CPU throttling graph showing python zig yet the test is for python and Go. I think you forgot to change that before deploying.

    • @exapsy
      @exapsy 3 หลายเดือนก่อน

      He noticed, he even put a small text at one timestamp. He likely just forgot to change the label.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thanks, it just copy paste mistake from the previous benchmark

  • @ac130kz
    @ac130kz 3 หลายเดือนก่อน +2

    even proper json serialization with orjson won't help django, it's just too slow

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      what about async views? have you tried it?

    • @ac130kz
      @ac130kz 3 หลายเดือนก่อน

      @@AntonPutra it's sill not a big improvement, and Django is still deeply synchronous. Some folks rewrote ORM's object property resolution in Rust, which made a ton of improvement for big objects

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      @@ac130kz ok

  • @SAsquirtle
    @SAsquirtle 3 หลายเดือนก่อน

    please do one with FastAPI with purely async routes (async route function + async function calls inside or run_in_threadpool for sync functions)

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      ok will do

  • @hiteshmohite7677
    @hiteshmohite7677 2 หลายเดือนก่อน

    Hey friend,
    Can you make comparison of Go - Gin vs Python - FastAPI vs Java - Spring Boot

    • @AntonPutra
      @AntonPutra  2 หลายเดือนก่อน

      ok just added to my list

  • @tacorevenge87
    @tacorevenge87 3 หลายเดือนก่อน +1

    Wow man love your videos

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thank you!

  • @erlanggafauzanrezaganie9595
    @erlanggafauzanrezaganie9595 3 หลายเดือนก่อน

    i really like your content, but can you try modify the django to use uvicorn instead ? i'd like to see how much the different

  • @martinhotmann7868
    @martinhotmann7868 3 หลายเดือนก่อน +1

    At "CPU Throtteling" you mislabled the blue line as "Zig" instead of "Go" ;)

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      yes, it is from the previous benchmark a ran, it just copy paste :)

  • @reiuji_utsuho
    @reiuji_utsuho 3 หลายเดือนก่อน +1

    Python has always been great for prototyping and scripting. But as always, once you get to the point where you need serious performance it's best to rewrite in some other language.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      Some large companies are still using Django in production because it's very hard for them to migrate, lots of features

  • @vlatterran
    @vlatterran 3 หลายเดือนก่อน +1

    Need some go vs nim benchmarks

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      noted

  • @UnnamedChastise
    @UnnamedChastise 21 วันที่ผ่านมา

    Great work!.Java with Spring Boot and Python with FastAPI please

  • @ashish99311
    @ashish99311 3 หลายเดือนก่อน +1

    Please make video on NEST JS and RUST Vs RUST

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      ok, node is next

  • @soubinan
    @soubinan 3 หลายเดือนก่อน

    Thanks for this benchmark
    Would be good to have go vs python but with fastapi and robyn (python flask like but based on rust)

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      ok, next time i'll use async functions in python, should be faster

  • @lohithvenkatesh4831
    @lohithvenkatesh4831 3 หลายเดือนก่อน

    Can you compare Robyn vs gin please?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      ok, noted!

  • @rafael_tg
    @rafael_tg หลายเดือนก่อน

    Please compare with fastapi

  • @dominikgasparic2930
    @dominikgasparic2930 3 หลายเดือนก่อน

    Cool video, but I noticed that Debug mode is turned on for django in repo

    • @dominikgasparic2930
      @dominikgasparic2930 3 หลายเดือนก่อน +1

      I would also get rid of security and auth middlewares since you are not using auth and sec in go. Another thing is i18n. Django dev here 😂. Do you accept PRs?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thanks, no, it's turned on for local development only. for deploying to prod, it is turned off - github.com/antonputra/tutorials/blob/main/lessons/209/deploy/django-app/configmap.yaml#L23

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      sure, i would love to accept any PRs to improve both applications, just keep that in mind
      local dev settings - github.com/antonputra/tutorials/blob/main/lessons/209/mydjango/mydjango/settings.py
      prod settings - github.com/antonputra/tutorials/blob/main/lessons/209/deploy/django-app/configmap.yaml

  • @iulikdev
    @iulikdev 3 หลายเดือนก่อน +3

    Please test elixir/phoenix to debunk the greatest elixir! 🤣

    • @infantfrontender6131
      @infantfrontender6131 3 หลายเดือนก่อน +1

      Debunk? Elixir is not faster than Go. It may be quicker than Python, but it depends
      The question is how to compare Elixir with their own fault-tolerance system. Do we need to use Docker with Elixir or not? Elixir has self-healing at the code level, and Docker can add it at the cluster

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      sure, will do it soon

  • @Mbd3Bal7dod
    @Mbd3Bal7dod 3 หลายเดือนก่อน

    do FastAPI with python 3.12 or 3.13

  • @ionutale1950
    @ionutale1950 3 หลายเดือนก่อน +1

    That Python memory usage, may not be correct.
    Garbage collected memory, should have spikes

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      I have a few metrics for memory, but this metric in the graph is actually used to OOM kill the pod by k8s.

    • @broccoli-dev
      @broccoli-dev 3 หลายเดือนก่อน +1

      Python uses reference counting primarily. So memory is freed as soon as it's no longer used versus at some later time, excepting cyclic references.

    • @ionutale1950
      @ionutale1950 3 หลายเดือนก่อน

      It makes sense

  • @ArturDani
    @ArturDani 3 หลายเดือนก่อน

    Nice work as always.
    Could you please do Laravel vs Express vs Django?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thanks! i'll do express next

  • @tasty-science-channel
    @tasty-science-channel 3 หลายเดือนก่อน +3

    You can write django app in days instead of months for the go version. Just start the MVP with django, it scales horizontally well and add some go stuffs if your app becomes really successful. Otherwise it will sit on your $5 vm processing 10 request per day which comes from yourelf. Good bye

  • @salim444
    @salim444 3 หลายเดือนก่อน

    this is a great series. Can you try go gnat and zig zzz libraries?

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      ok noted!

  • @BobaZooba
    @BobaZooba 2 หลายเดือนก่อน

    Please make a kotlin ktor vs Go stdlib

  • @jeniamtl6950
    @jeniamtl6950 3 หลายเดือนก่อน

    Does go use stblib? I don't think so.

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      yes it does - github.com/antonputra/tutorials/blob/main/lessons/209/go-app/main.go#L88-L90
      It's a bit slower than Fiber, though

  • @toragodzen
    @toragodzen 2 หลายเดือนก่อน

    Django is for the quickest path from the idea to something actually working ... And this is why I will keep using even watching how it dramatically fails in benchmark tests 😂

  • @fojico1234
    @fojico1234 3 หลายเดือนก่อน +1

    Django Vs stdlib!!!!. Pick a lightweight library Vs another lightweight please

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน +1

      sure, someone just asked me to compare django so i did

  • @miguelalzate4850
    @miguelalzate4850 3 หลายเดือนก่อน +1

    I would like to see go vs node.js😁

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      next

  • @zakimimit
    @zakimimit 3 หลายเดือนก่อน

    Can we see:
    -Django DRF vs Django ninja
    -Django with celery Vs nodjs or Go
    This will be fair comparison
    Thank you for the content

    • @johnmcway6120
      @johnmcway6120 2 หลายเดือนก่อน

      what do you mean django with celery?

  • @lastink444
    @lastink444 3 หลายเดือนก่อน +1

    such a nice series

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      thank you!