Skip to content

Commit

Permalink
Optimise parsing by removing excessive copying. (#278)
Browse files Browse the repository at this point in the history
* Optimise parsing by removing excessive copying.

* Add benchmark

---------

Co-authored-by: Joannis Orlandos <joannis@orlandos.nl>
  • Loading branch information
maciejtrybilo and Joannis authored Feb 12, 2024
1 parent c125e55 commit ced9c53
Show file tree
Hide file tree
Showing 8 changed files with 1,311 additions and 27 deletions.
28 changes: 28 additions & 0 deletions Benchmarks/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"configurations": [
{
"type": "lldb",
"request": "launch",
"sourceLanguages": [
"swift"
],
"args": [],
"cwd": "${workspaceFolder:Benchmarks}",
"name": "Debug XMLCoderBenchmarks",
"program": "${workspaceFolder:Benchmarks}/.build/debug/XMLCoderBenchmarks",
"preLaunchTask": "swift: Build Debug XMLCoderBenchmarks"
},
{
"type": "lldb",
"request": "launch",
"sourceLanguages": [
"swift"
],
"args": [],
"cwd": "${workspaceFolder:Benchmarks}",
"name": "Release XMLCoderBenchmarks",
"program": "${workspaceFolder:Benchmarks}/.build/release/XMLCoderBenchmarks",
"preLaunchTask": "swift: Build Release XMLCoderBenchmarks"
}
]
}
14 changes: 14 additions & 0 deletions Benchmarks/Benchmarks/XMLCoderBenchmarks/Benchmark.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Benchmark

let benchmarks = {
Benchmark(
"XMLDecoder",
configuration: .init(
metrics: [
.throughput
]
)
) { benchmark in
try runXMLDecoder()
}
}
Loading

0 comments on commit ced9c53

Please sign in to comment.