Add fixes performance and static web server

This commit is contained in:
Justine Tunney 2020-10-05 23:11:49 -07:00
parent b6793d42d5
commit c45e46f871
108 changed files with 2927 additions and 819 deletions

View file

@ -7,59 +7,77 @@ TOOL_NET_FILES := $(wildcard tool/net/*)
TOOL_NET_SRCS = $(filter %.c,$(TOOL_NET_FILES))
TOOL_NET_HDRS = $(filter %.h,$(TOOL_NET_FILES))
TOOL_NET_OBJS = \
$(TOOL_NET_SRCS:%=o/$(MODE)/%.zip.o) \
TOOL_NET_OBJS = \
$(TOOL_NET_SRCS:%=o/$(MODE)/%.zip.o) \
$(TOOL_NET_SRCS:%.c=o/$(MODE)/%.o)
TOOL_NET_COMS = \
TOOL_NET_COMS = \
$(TOOL_NET_SRCS:%.c=o/$(MODE)/%.com)
TOOL_NET_BINS = \
$(TOOL_NET_COMS) \
TOOL_NET_BINS = \
$(TOOL_NET_COMS) \
$(TOOL_NET_COMS:%=%.dbg)
TOOL_NET_DIRECTDEPS = \
LIBC_CALLS \
LIBC_CONV \
LIBC_DNS \
LIBC_FMT \
LIBC_LOG \
LIBC_NEXGEN32E \
LIBC_RUNTIME \
LIBC_SOCK \
LIBC_STDIO \
LIBC_STR \
LIBC_STUBS \
LIBC_SYSV \
LIBC_TIME \
LIBC_UNICODE \
LIBC_X \
NET_HTTP \
THIRD_PARTY_GETOPT \
TOOL_NET_DIRECTDEPS = \
LIBC_ALG \
LIBC_BITS \
LIBC_CALLS \
LIBC_CONV \
LIBC_DNS \
LIBC_FMT \
LIBC_LOG \
LIBC_LOG_ASAN \
LIBC_MEM \
LIBC_NEXGEN32E \
LIBC_RUNTIME \
LIBC_SOCK \
LIBC_STDIO \
LIBC_STR \
LIBC_STUBS \
LIBC_SYSV \
LIBC_SYSV_CALLS \
LIBC_TIME \
LIBC_UNICODE \
LIBC_X \
NET_HTTP \
THIRD_PARTY_GETOPT \
THIRD_PARTY_ZLIB \
TOOL_DECODE_LIB
TOOL_NET_DEPS := \
TOOL_NET_DEPS := \
$(call uniq,$(foreach x,$(TOOL_NET_DIRECTDEPS),$($(x))))
o/$(MODE)/tool/net/net.pkg: \
$(TOOL_NET_OBJS) \
o/$(MODE)/tool/net/net.pkg: \
$(TOOL_NET_OBJS) \
$(foreach x,$(TOOL_NET_DIRECTDEPS),$($(x)_A).pkg)
o/$(MODE)/tool/net/%.com.dbg: \
$(TOOL_NET_DEPS) \
o/$(MODE)/tool/net/%.o \
o/$(MODE)/tool/net/net.pkg \
$(CRT) \
o/$(MODE)/tool/net/%.com.dbg: \
$(TOOL_NET_DEPS) \
o/$(MODE)/tool/net/%.o \
o/$(MODE)/tool/net/net.pkg \
$(CRT) \
$(APE)
@$(APELINK)
o/$(MODE)/tool/net/redbean.com.dbg: \
$(TOOL_NET_DEPS) \
o/$(MODE)/tool/net/redbean.o \
o/$(MODE)/tool/net/redbean.ico.zip.o \
o/$(MODE)/tool/net/redbean.png.zip.o \
o/$(MODE)/tool/net/redbean.css.zip.o \
o/$(MODE)/tool/net/redbean.html.zip.o \
o/$(MODE)/tool/net/net.pkg \
$(CRT) \
$(APE)
@$(APELINK)
ifeq (,$(MODE))
$(TOOL_NET_A_OBJS): \
OVERRIDE_CFLAGS += \
$(TOOL_NET_OBJS): \
OVERRIDE_CFLAGS += \
-fsanitize=address
endif
.PHONY: o/$(MODE)/tool/net
o/$(MODE)/tool/net: \
$(TOOL_NET_BINS) \
o/$(MODE)/tool/net: \
$(TOOL_NET_BINS) \
$(TOOL_NET_CHECKS)

File diff suppressed because it is too large Load diff

43
tool/net/redbean.css Normal file
View file

@ -0,0 +1,43 @@
html {
font-family: sans-serif;
font-size: 14pt;
}
body {
max-width: 700px;
min-width: 700px;
margin: 0 auto 0 auto;
}
pre,
code {
font-family: monospace;
font-size: 12pt;
}
p {
text-align: justify;
}
.indent {
margin-left: 1em;
}
h1,
h2 {
margin: 1.5em 0 1.5em 0;
}
h1 strong {
font-size: 14pt;
}
footer {
margin-top: 12em;
margin-bottom: 3em;
font-size: 14pt;
}
.logo {
float: right;
}

View file

@ -1,6 +1,29 @@
<!doctype html>
<meta charset="utf-8">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Mono&display=swap">
<link rel="stylesheet" href="style.css">
<img src="redbean.png" style="float:right" width="64" height="64">
<h1>Red Bean</h1>
<title>redbean</title>
<link rel="stylesheet" href="redbean.css">
<img src="redbean.png" class="logo" width="84" height="84">
<h2>
<big>redbean</big><br>
<small>distributable static web server</small>
</h2>
<p>
Here's what you need to know about redbean:
<ul>
<li>million qps on modern pc
<li>container is executable zip file
<li>userspace filesystem w/o syscall overhead
<li>kernelspace zero-copy gzip encoded responses
<li>executable runs on linux, bsd, mac, and windows
</ul>
<p>
redbean is based on <a href="https://justine.storage.googleapis.com/ape.html">αcτµαlly pδrταblε εxεcµταblε</a>
and <a href="https://github.com/jart/cosmopolitan">cosmopolitan</a>.
<br>
redbean is authored by Justine Tunney who's on
<a href="https://github.com/jart">GitHub</a> and
<a href="https://twitter.com/JustineTunney">Twitter</a>.