Skip to content
DevMeme
2892 of 7435
Chrome hogs 500 MB, Python demolishes 10 GB parsing one XML file
Performance Post #3197, on Jun 7, 2021 in TG

Chrome hogs 500 MB, Python demolishes 10 GB parsing one XML file

Description

Two - panel Winnie-the-Pooh meme. Top panel shows a casually dressed Pooh leaning back with half-closed eyes; white background text reads: “Chrome: uses 500 MB to open 3 tabs”. Bottom panel shows the same bear in a tuxedo, looking pleased; white background text reads: “Python: uses 10 GB to parse a 50 MB XML file”. The joke contrasts Chrome’s notorious browser memory bloat with an even more extreme case of Python’s run-time overhead when loading large XML documents, poking fun at modern software’s inefficiency and the hidden performance costs of high-level parsing libraries

Comments

19
Anonymous ★ Top Pick Chrome burning 500 MB for three tabs is cute - my Python ETL needs a 10 GB Kubernetes pod to turn a 50 MB XML into the 12 bytes of JSON the SPA actually uses
  1. Anonymous ★ Top Pick

    Chrome burning 500 MB for three tabs is cute - my Python ETL needs a 10 GB Kubernetes pod to turn a 50 MB XML into the 12 bytes of JSON the SPA actually uses

  2. Anonymous

    We'll spend weeks optimizing a database query to save 100ms, then casually load a 2GB pandas DataFrame into memory just to filter 10 rows because 'RAM is cheap' - until production crashes at 3am

  3. Anonymous

    The real sophistication here is that both are technically correct: Chrome's 500MB for 3 tabs is just aggressive tab caching and V8 heap allocation, while Python's 10GB for a 50MB XML file is what happens when you accidentally use xml.dom.minidom instead of lxml's iterparse() and load the entire DOM tree into memory. At least Chrome has the decency to blame each tab's renderer process separately - Python just hands you one massive memory spike and a sheepish 'well, you did ask me to parse it' shrug

  4. Anonymous

    Python's XML parser: because streaming was too efficient for that 'batteries included' philosophy

  5. Anonymous

    We roast Chrome for 500MB, then parse a 50MB XML in Python with xmltodict, materialize a 10GB DOM of Unicode strings and dicts, and wonder why Kubernetes keeps OOM‑killing the pod

  6. Anonymous

    Chrome treats 500MB as freemium; Python’s ElementTree says “hold my GIL” - every tag becomes a handful of Unicode objects and dicts, turning 50MB into a 10GB object graph unless you iterparse

  7. Deleted Account 5y

    Java*

    1. @prirai 5y

      Is it?

  8. @fie_n 5y

    F

  9. @a_desant 5y

    I have been parsing several 10gb xmls with python. After some time optimizing I have managed to parse these xmls using 8gb of ram and 6gb swap. You can check the code here btw https://github.com/Desantnikov/huge_xmls_parser

    1. @yarmoliq 5y

      What do you store in 10gb xml? Database :D

      1. @a_desant 5y

        It was a list of all entrepreneurs in my country. For some reasons our government's IT guys decided to store them in xml

        1. @ogroleg 5y

          Why don't you use lxml iterative parser?

          1. @a_desant 5y

            I have used it

            1. @ogroleg 5y

              Why does it use 8gb of ram then? (just curious)

              1. dev_meme 5y

                There could be really big files for gov purposes👀

      2. @ZgGPuo8dZef58K6hxxGVj3Z2 5y

        It uses 10GB RAM to keep in memory at what part it is

  10. @pyproman 5y

    JS: I want 1 TB of RAM

    1. @azizhakberdiev 5y

      *Electron

Use J and K for navigation