I wonder how fast is this server. Is handwritten assembly faster than GCC/clang-written assembly?
I don't want to be too harsh - this is a fun idea, and I'm prone to silly fantasies about rewriting slow code in assembly myself - but this particular assembly doesn't take advantage of many of the "dirty tricks" that are available in low-level code. As one example, check out the content-type detection, which is essentially a long chain of repeated strlen + strcmp; assembly language doesn't magically make bad algorit…
Web server for Linux written in amd64 assembly
51–59 of 59 posts
Re: Web server for Linux written in amd64 assembly
#52Earlier quoted context omitted.
I guess he's talking about Borland's Turbo Assembler that was coming with Turbo Pascal: http://en.wikipedia.org/wiki/Turbo_Assembler
My remark was because the OP used bytecode to describe assembly opcodes.
Re: Web server for Linux written in amd64 assembly
#53Re: Web server for Linux written in amd64 assembly
#54Earlier quoted context omitted.
Security through transparency and readability for a bigger audience.
That's a great reason not to use this. Doesn't seem a reason not to do it.
I wrote a web server in C. I'm not really a web guy, it was a lot of new stuff to me, I'm a pretty amateurish programmer, and it probably doesn't even deserve to be called a "web server". But it was fun, and really cool to know that something that I wrote (with the help/jump-off point of a tutorial or two) can be used to serve web pages to a client. I can run the program, pop open Firefox, and use the browser to click through a set of test pages as though it was being served by a real web server. That's fucking cool, and that was all the reason that I needed to do it.
Don't Reinvent The Wheel - unless you want to!
Re: Web server for Linux written in amd64 assembly
#55Runs with about 3% less CPU load than apache on my server. However apache also does ALLOT more stuff.
Re: Web server for Linux written in amd64 assembly
#56Earlier quoted context omitted.
My remark was because the OP used bytecode to describe assembly opcodes.
The usage is nonstandard, but it provides an interesting perspective. What if he was planning to run the X86 code on a virtual CPU, is his usage then correct? Does the nature of compiled code change if it is executing on a "real" machine instead of a virtual one?
Re: Web server for Linux written in amd64 assembly
#57asmttpd - 0.04 Using Document Root: htdocs/ An error has occured, exiting
Re: Web server for Linux written in amd64 assembly
#58I'm surprised that asmhttpd doesn't use sendfile(2) anywhere. Isn't that the fastest way to send a file to a socket?