Skip to content

Commit 35f51bc

Browse files
README updates (toned down verbiage; removed 2 time benchmarks)
1 parent f2b5d00 commit 35f51bc

File tree

1 file changed

+13
-59
lines changed

1 file changed

+13
-59
lines changed

README.md

Lines changed: 13 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Write HTML using Swift Macros.
22

33
<a href="https://swift.org"><img src="https://img.shields.io/badge/Swift-5.9+-orange" alt="Requires at least Swift 5.9"></a> <img src="https://img.shields.io/badge/Platforms-Any-gold"> <a href="https://github.com/RandomHashTags/swift-htmlkit/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-blue" alt="Apache 2.0 License">
44

5-
- [Why?](#why)
5+
- [Why](#why)
66
- [Examples](#examples)
77
- [Basic](#basic)
88
- [Advanced](#advanced)
@@ -11,10 +11,10 @@ Write HTML using Swift Macros.
1111
- [Contributing](#contributing)
1212
- [Funding](#funding)
1313

14-
## Why?
15-
- Swift Macros are powerful and offer performance benefits
16-
- Alternative libraries may not fit all situations and may restrict how the html is generated/manipulated, prone to human error, or cost a constant performance overhead (middleware, rendering, result builders, etc)
17-
- HTML macros enforce safety, can be used anywhere, and compile directly to strings which are easily manipulated
14+
## Why
15+
- Swift Macros are powerful, efficient and essentially removes any runtime overhead
16+
- Alternative libraries may not fit all situations and may restrict how the html is generated, manipulated, prone to human error, or cost a constant performance overhead (middleware, rendering, result builders, etc)
17+
- HTML macros enforce safety, can be used anywhere, and compile directly to strings
1818
- The output is minified at no performance cost
1919
## Examples
2020
### Basic
@@ -160,7 +160,7 @@ Worth noting that the metrics not shown below are relatively equal to each other
160160
Output is from executing this command: `swift package -c release benchmark --grouping metric`
161161

162162
<details>
163-
<summary>Time (wall clock) [less is better] <i>[winner: swift-htmlkit by 3-15x]</i></summary>
163+
<summary>Time (wall clock) [less is better]</summary>
164164

165165
```swift
166166
Time (wall clock)
@@ -181,7 +181,7 @@ Time (wall clock)
181181
</details>
182182

183183
<details>
184-
<summary>Throughput (# / s) [more is better] <i>[winner: swift-htmlkit by 3-15x]</i></summary>
184+
<summary>Throughput (# / s) [more is better]</summary>
185185

186186
```swift
187187
Throughput (# / s)
@@ -202,7 +202,7 @@ Throughput (# / s)
202202
</details>
203203

204204
<details>
205-
<summary>Instructions [less is better] <i>[winner: swift-htmlkit by 75-637x]</i></summary>
205+
<summary>Instructions [less is better]</summary>
206206

207207
```swift
208208
Instructions
@@ -223,7 +223,7 @@ Instructions
223223
</details>
224224

225225
<details>
226-
<summary>Malloc (total) [less is better] <i>[winner: swift-htmlkit]</i></summary>
226+
<summary>Malloc (total) [less is better]</summary>
227227

228228
```swift
229229
Malloc (total)
@@ -245,7 +245,7 @@ Malloc (total)
245245
</details>
246246

247247
<details>
248-
<summary>Object allocs [less is better] <i>[winner: swift-htmlkit]</i></summary>
248+
<summary>Object allocs [less is better]</summary>
249249

250250
```swift
251251
Object allocs
@@ -267,7 +267,7 @@ Object allocs
267267
</details>
268268

269269
<details>
270-
<summary>Releases [less is better] <i>[winner: swift-htmlkit]</i></summary>
270+
<summary>Releases [less is better]</summary>
271271

272272
```swift
273273
Releases
@@ -289,7 +289,7 @@ Releases
289289
</details>
290290

291291
<details>
292-
<summary>Retains [less is better] <i>[winner: swift-htmlkit & Elementary]</i></summary>
292+
<summary>Retains [less is better]</summary>
293293

294294
```swift
295295
Retains
@@ -310,56 +310,10 @@ Retains
310310

311311
</details>
312312

313-
<details>
314-
<summary>Time (user CPU) [less is better] <i>[winner: swift-htmlkit]</i></summary>
315-
316-
```swift
317-
Time (user CPU)
318-
╒═════════════════════════════════════════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╕
319-
Test p0 p25 p50 p75 p90 p99 p100 Samples
320-
╞═════════════════════════════════════════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╡
321-
Benchmarks:Elementary simpleHTML() (ns) * 4501 4807 4907 5019 5147 6643 39542 10000
322-
├─────────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
323-
Benchmarks:Plot simpleHTML() (μs) * 20 21 22 22 23 34 272 10000
324-
├─────────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
325-
Benchmarks:SwiftHTMLKit simpleHTML() (ns) * 1606 1768 1798 1841 1891 3265 27394 10000
326-
├─────────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
327-
Benchmarks:SwiftHTMLPF simpleHTML() (μs) * 12 13 13 14 14 29 76 10000
328-
├─────────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
329-
Benchmarks:VaporHTMLKit simpleHTML() (ns) * 5175 5451 5543 5643 5755 11527 22320 10000
330-
╘═════════════════════════════════════════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╛
331-
```
332-
333-
</details>
334-
335-
<details>
336-
<summary>Time (total CPU) [less is better] <i>[winner: swift-htmlkit]</i></summary>
337-
338-
```swift
339-
Time (total CPU)
340-
╒═════════════════════════════════════════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╕
341-
Test p0 p25 p50 p75 p90 p99 p100 Samples
342-
╞═════════════════════════════════════════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╡
343-
Benchmarks:Elementary simpleHTML() (ns) * 8142 8535 8687 8943 9159 11911 53014 10000
344-
├─────────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
345-
Benchmarks:Plot simpleHTML() (μs) * 24 26 26 26 27 41 1154 10000
346-
├─────────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
347-
Benchmarks:SwiftHTMLKit simpleHTML() (ns) * 5052 5471 5527 5647 5867 9655 41376 10000
348-
├─────────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
349-
Benchmarks:SwiftHTMLPF simpleHTML() (μs) * 16 17 17 18 18 36 109 10000
350-
├─────────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
351-
Benchmarks:VaporHTMLKit simpleHTML() (ns) * 8994 9351 9495 9791 9967 18255 90987 10000
352-
╘═════════════════════════════════════════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╛
353-
```
354-
355-
</details>
356-
357313
</details>
358314

359315
### Conclusion
360-
This library beats every other Swift HTML library in terms of performance & efficiency.
361-
362-
So stop wasting system resources and energy using other libraries by switching to this one.
316+
This library is the clear leader in performance & efficiency with 75x less instructions and 3x better performance _at minimum_.
363317

364318
## Contributing
365319
Create a PR.

0 commit comments

Comments
 (0)