-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from fracek/techempower-bench
- Loading branch information
Showing
9 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module: techempower-benchmarks | ||
synopsis: json serialization benchmark. | ||
author: Francesco Ceccon | ||
define class <json-page> (<resource>) | ||
constant slot hello-string = "Hello, World!"; | ||
slot message :: <string-table>; | ||
end class; | ||
|
||
define method initialize (page :: <json-page>, #key) | ||
page.message := table(<string-table>, "message" => "Hello, World!"); | ||
end method; | ||
|
||
// set the correct content-type, then send "Hello, World!". | ||
define method respond (page :: <json-page>, #key) | ||
set-header(current-response(), "Content-Type", "application/json"); | ||
output(write-object-to-json-string(page.message)); | ||
end method respond; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module: dylan-user | ||
synopsis: TechEmpower plaintext benchmark | ||
author: Francesco Ceccon | ||
define library techempower-benchmarks | ||
use common-dylan; | ||
use http-common; | ||
use http-server; | ||
use serialization; | ||
use collections; | ||
end; | ||
|
||
|
||
define module techempower-benchmarks | ||
use common-dylan; | ||
use http-common; | ||
use http-server; | ||
use json-serialization; | ||
use table-extensions; | ||
end; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module: techempower-benchmarks | ||
define function map-resources (server :: <http-server>) | ||
add-resource(server, "/json", make(<json-page>)); | ||
add-resource(server, "/plaintext", make(<plaintext-page>)); | ||
end function map-resources; | ||
|
||
define function main () | ||
http-server-main(server: make(<http-server>, | ||
listeners: list("127.0.0.1:8000")), | ||
before-startup: map-resources); | ||
end function main; | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module: techempower-benchmarks | ||
synopsis: plaintext benchmark. | ||
author: Francesco Ceccon | ||
define class <plaintext-page> (<resource>) | ||
constant slot hello-string = "Hello, World!"; | ||
end class; | ||
|
||
// set the correct content-type, then send "Hello, World!". | ||
define method respond (page :: <plaintext-page>, #key) | ||
set-header(current-response(), "Content-Type", "text/plain"); | ||
output(page.hello-string); | ||
end method respond; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
library: techempower-benchmarks | ||
target-type: executable | ||
files: library | ||
plaintext | ||
json | ||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abstract://dylan/submodules/serialization/serialization.lid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abstract://dylan/examples/techempower-benchmarks/techempower-benchmarks.lid |
Submodule serialization
added at
2cdb9f