TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Big list of http static server one-liners

33 点作者 soupdiver将近 11 年前

2 条评论

mariocesar将近 11 年前
Just notice the difference between python2 and python3 simple http server<p><pre><code> $ python -m SimpleHTTPServer 8000 $ python3 -m http.server 8000 </code></pre> Even the python3 is nicer to read, I really like that they package the server in a module. It&#x27;s almost twice as slower in my machine.<p>Python2 Benchmark<p><pre><code> Requests per second: 606.03 [#&#x2F;sec] (mean) Time per request: 8.250 [ms] (mean) Time per request: 1.650 [ms] (mean, across all concurrent requests) Transfer rate: 4412.05 [Kbytes&#x2F;sec] received </code></pre> And Python3 Benchmark<p><pre><code> Requests per second: 412.51 [#&#x2F;sec] (mean) Time per request: 12.121 [ms] (mean) Time per request: 2.424 [ms] (mean, across all concurrent requests) Transfer rate: 3003.17 [Kbytes&#x2F;sec] received </code></pre> Both 1000 requests, concurrency level of 5. Listing a large directory with thousands of files.<p>I usually use python simple http server to share files and provide synchronization. One hopes that with a new python release it will get faster or at least smarter, both are the same implementation with no noticeable difference, just that python3 is slower.
farva将近 11 年前
Looks like Zawinski&#x27;s Law needs to be revised: &quot;Every program attempts to expand until it can serve HTML.&quot;
评论 #7928633 未加载