4 ms·
But I bet it took a lot more code than: python3 -m http.server Note also that Python is primarily reference counted, with GC used only to detect cyclic refe
by kbutler 7y ago
But I bet it took a lot more code than:
python3 -m http.server
Note also that Python is primarily reference counted, with GC used only to detect cyclic references.
- heavenlyblue 7y agoI am not serving static content, so this reply is absolutely irrelevant. On top of this, you can do the same with docker run nginx -v.:/var/www (which btw is a similar number of symbols). Also python’s http module barely supports anything but the most basic content-types (so good luck with eg SVGs).
- kbutler 7y agoAt a few more orders of magnitude of memory use, sure. Tradeoffs everywhere, which make sense or not depending on your requirements. But Python's ref counting isn't a significant factor in its memory use.
- heavenlyblue 7y ago>> At a few more orders of magnitude of memory use, sure. Are you implying nginx uses more memory than a python interpreter? :)
- chrisseaton 7y agoReference counting is a form of garbage collection.
- kbutler 7y agoSure, if you want to be pedantic, but the context was limited memory use, and ref counting does not increase the memory used for unreferenced objects (except in cycles) unlike most other garbage collection algorithms.
- johnsoft 7y agoEven just loading the base Python interpreter uses more memory than heavenlyblue's entire server. USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 23612 1.2 1.7 62412 17492 pts/1 S+ 12:38 0:00 | \_ python3 -m http.server
- deleted 7y ago[deleted]