Skip to content

Commit 3ecd8a7

Browse files
update README with latest changes & updated benchmark pngs
1 parent ce22a90 commit 3ecd8a7

File tree

5 files changed

+193
-95
lines changed

5 files changed

+193
-95
lines changed

Benchmarks/Benchmarks/SwiftHTMLKit/SwiftHTMLKit.swift

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,52 @@ package struct SwiftHTMLKitTests : HTMLGenerator {
1414

1515
package func staticHTML() -> String {
1616
#html(
17-
#head(
18-
#title("StaticView")
19-
),
20-
#body(
21-
#h1("Swift HTML Benchmarks")
17+
html(
18+
head(
19+
title("StaticView")
20+
),
21+
body(
22+
h1("Swift HTML Benchmarks")
23+
)
2224
)
2325
)
2426
}
2527

2628
package func staticHTMLUTF8Bytes() -> [UInt8] {
27-
#htmlUTF8Bytes(
28-
#head(
29-
#title("StaticView")
30-
),
31-
#body(
32-
#h1("Swift HTML Benchmarks")
29+
#html(encoding: .utf8Bytes,
30+
html(
31+
head(
32+
title("StaticView")
33+
),
34+
body(
35+
h1("Swift HTML Benchmarks")
36+
)
3337
)
3438
)
3539
}
3640

3741
package func staticHTMLUTF16Bytes() -> [UInt16] {
38-
#htmlUTF16Bytes(
39-
#head(
40-
#title("StaticView")
41-
),
42-
#body(
43-
#h1("Swift HTML Benchmarks")
42+
#html(encoding: .utf16Bytes,
43+
html(
44+
head(
45+
title("StaticView")
46+
),
47+
body(
48+
h1("Swift HTML Benchmarks")
49+
)
4450
)
4551
)
4652
}
4753

4854
package func staticHTMLByteBuffer() -> ByteBuffer {
49-
#htmlByteBuffer(
50-
#head(
51-
#title("StaticView")
52-
),
53-
#body(
54-
#h1("Swift HTML Benchmarks")
55+
#html(encoding: .byteBuffer,
56+
html(
57+
head(
58+
title("StaticView")
59+
),
60+
body(
61+
h1("Swift HTML Benchmarks")
62+
)
5563
)
5664
)
5765
}
@@ -65,23 +73,25 @@ package struct SwiftHTMLKitTests : HTMLGenerator {
6573
package func dynamicHTML(_ context: HTMLContext) -> String {
6674
var qualities:String = ""
6775
for quality in context.user.qualities {
68-
qualities += #li("\(quality)")
76+
qualities += #html(li(quality))
6977
}
7078
return #html(
71-
#head(
72-
#meta(charset: "\(context.charset)"),
73-
#title("\(context.title)"),
74-
#meta(content: "\(context.meta_description)", name: "description"),
75-
#meta(content: "\(context.keywords_string)", name: "keywords")
76-
),
77-
#body(
78-
#h1("\(context.heading)"),
79-
#div(attributes: [.id(context.desc_id)],
80-
#p("\(context.string)")
79+
html(
80+
head(
81+
meta(charset: "\(context.charset)"),
82+
title("\(context.title)"),
83+
meta(content: "\(context.meta_description)", name: "description"),
84+
meta(content: "\(context.keywords_string)", name: "keywords")
8185
),
82-
#h2("\(context.user.details_heading)"),
83-
#h3("\(context.user.qualities_heading)"),
84-
#ul(attributes: [.id(context.user.qualities_id)], "\(qualities)")
86+
body(
87+
h1("\(context.heading)"),
88+
div(attributes: [.id(context.desc_id)],
89+
p("\(context.string)")
90+
),
91+
h2("\(context.user.details_heading)"),
92+
h3("\(context.user.qualities_heading)"),
93+
ul(attributes: [.id(context.user.qualities_id)], "\(qualities)")
94+
)
8595
)
8696
)
8797
}
-113 KB
Loading
-117 KB
Loading

0 commit comments

Comments
 (0)