Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
47a2b91
Create pull_request.yml
oformaniuk Mar 15, 2020
54d3f1e
Create ci.yml
oformaniuk Mar 15, 2020
8311487
Create release.yml
oformaniuk Mar 15, 2020
8eae468
Update pull_request.yml
oformaniuk Mar 15, 2020
942420f
Add `Handlebars.Code.sln`
Mar 16, 2020
d7e3c11
Update pull_request.yml
oformaniuk Mar 16, 2020
cfea4b0
Update pull_request.yml
oformaniuk Mar 16, 2020
53e0109
Add netcoreapp3.1
oformaniuk Mar 16, 2020
c8f5ccc
Update pull_request.yml
oformaniuk Mar 16, 2020
b8b548b
Fix tests
oformaniuk Mar 16, 2020
e367f9e
Update ci.yml
oformaniuk Mar 17, 2020
5ab7eb3
Merge pull request #2 from zjklee/feature/pipelines
oformaniuk Apr 23, 2020
2f09a18
Support for BlockParams
Jan 7, 2020
4669550
Support for `ReturnHelper`
Jan 18, 2020
7b68b87
Further improvements
Mar 3, 2020
ec4ce77
Extreme refactoring/enhancements
oformaniuk Apr 23, 2020
b1c4901
Update readme
oformaniuk Apr 23, 2020
1165fa2
Update `Handlebars.Code.sln`
oformaniuk Apr 23, 2020
26a1a8b
Add performance results
oformaniuk Apr 23, 2020
380fe48
Fixing problems + improvements
oformaniuk Apr 24, 2020
294958e
Fix repack
oformaniuk Apr 24, 2020
17b0d43
Remove path segment cache
oformaniuk Apr 24, 2020
34d9256
Add extra test steps
oformaniuk Apr 24, 2020
dbf2d06
WIP: try disable FastCompile
oformaniuk Apr 24, 2020
4980f86
Fix SonarCloud comments
oformaniuk Apr 24, 2020
9683df9
Exclude `CompileFast` for Linux and MacOS
oformaniuk Apr 24, 2020
cb466f7
Make `sonar` actions back to Linux VMs
oformaniuk Apr 24, 2020
cc9b8f6
Merge pull request #3 from zjklee/hard-fork
oformaniuk Apr 24, 2020
4754191
Update README.md
oformaniuk Apr 24, 2020
a8c46f1
Fix `ILRepack` problem on build/pack
oformaniuk Apr 24, 2020
f3423fc
Fix publish
oformaniuk Apr 24, 2020
c8c8d67
Fix packaging
oformaniuk Apr 24, 2020
3a4f8fa
Remove `InternalsVisible` attribute
oformaniuk Apr 27, 2020
f8b699c
Merge pull request #5 from zjklee/fix/internalsvisible
oformaniuk Apr 27, 2020
bfcac83
Set dummy token for PR action
oformaniuk May 17, 2020
92d5bb1
Set real token
oformaniuk May 17, 2020
0b40d46
Remove release notes
oformaniuk May 17, 2020
5af777f
Merge pull request #9 from zjklee/feature/tokenless-sonar
oformaniuk May 17, 2020
8204633
Fix `value` variable leaking from `BindingContext`
oformaniuk May 18, 2020
ec849bd
Merge pull request #10 from zjklee/issues/7
oformaniuk May 18, 2020
ae3a40d
Fix code coverage
oformaniuk May 18, 2020
a4c3c39
Merge pull request #11 from zjklee/fix/code-coverage
oformaniuk May 18, 2020
d0270f1
Fix code coverage
oformaniuk May 18, 2020
93d51a9
Merge pull request #12 from zjklee/fix/code-coverage
oformaniuk May 18, 2020
58b6a7d
Fix CompileFast for Unix
oformaniuk May 18, 2020
e9f254e
Remove unused `using`
oformaniuk May 19, 2020
6b13c17
Update Readme with extensions info
oformaniuk May 19, 2020
2ae0d46
Merge pull request #13 from zjklee/fix/compile-fast
oformaniuk May 19, 2020
02c1370
Overload for CreateWriterView for CreateView
May 16, 2020
7f822b4
Cleaned up test for cleaner pr
May 16, 2020
b5ef30d
Implement `ViewReaderFactory` approach
oformaniuk May 30, 2020
a40e0ff
Merge pull request #8 from fhogberg/create-view-with-writer-output
oformaniuk May 30, 2020
e700983
Improve memory usage and performance
oformaniuk May 24, 2020
ec7a51c
Add Array.Empty polyfill, add Logger tests
oformaniuk May 30, 2020
2462b02
Remove unused method
oformaniuk May 30, 2020
726d481
Decrease code duplication
oformaniuk May 30, 2020
b183441
Merge pull request #14 from zjklee/feature/improve-perf
oformaniuk May 30, 2020
55965c4
Add test for the issue
oformaniuk May 30, 2020
c8f17e0
Merge pull request #17 from zjklee/issue/rexm/351
oformaniuk May 30, 2020
b182b8f
Update Readme
oformaniuk May 30, 2020
c141f3f
Make changes compatible with main repo
oformaniuk May 30, 2020
e0d71ec
Add `Extensions` information to Readme
oformaniuk May 30, 2020
756f136
Enable SonarCloud integration
oformaniuk May 31, 2020
68181df
Fix passing context to `helper`s
oformaniuk May 31, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI

on:
push:
branches: [ master ]

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.806
- name: Build netstandard2.0
working-directory: ./source
run: dotnet build Handlebars/Handlebars.csproj -c Release -f netstandard2.0
- name: Build netstandard1.3
working-directory: ./source
run: dotnet build Handlebars/Handlebars.csproj -c Release -f netstandard1.3
- name: Build net452
working-directory: ./source
run: dotnet build Handlebars/Handlebars.csproj -c Release -f net452


test-windows:
runs-on: windows-latest
needs: [build]
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.806
- name: Test
working-directory: ./source
run: dotnet test ./Handlebars.Test/Handlebars.Test.csproj -f netcoreapp2.1 --logger:trx


test-linux:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.806
- name: Test
working-directory: ./source
run: dotnet test ./Handlebars.Test/Handlebars.Test.csproj -f netcoreapp2.1 --logger:trx


test-macos:
runs-on: macos-latest
needs: [build]
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.806
- name: Test
working-directory: ./source
run: dotnet test ./Handlebars.Test/Handlebars.Test.csproj -f netcoreapp2.1 --logger:trx


sonar-ci:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.806
- name: Sonarscanner for dotnet
uses: Secbyte/dotnet-sonarscanner@v2.2
with:
buildCommand: dotnet build source/Handlebars/Handlebars.csproj -f netstandard2.0
testCommand: dotnet test source/Handlebars.Test/Handlebars.Test.csproj -f netcoreapp2.1 --logger:trx --collect:"XPlat Code Coverage" --settings source/Handlebars.Test/coverlet.runsettings
projectKey: zjklee_handlebars.csharp
projectName: handlebars.csharp
sonarOrganisation: zjklee
beginArguments: >
/d:sonar.verbose="true"
/d:sonar.cs.opencover.reportsPaths="**/*.opencover.xml"
/d:sonar.coverage.exclusions="**/*.md"
/d:sonar.cs.vstest.reportsPaths="**/*.trx"

env:
SONAR_TOKEN: 0a2d91d681b618b29a293e3d1e7e1e9ea82710a2
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88 changes: 88 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Pull Request

on:
pull_request:
branches: [ master ]

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.806
- name: Build netstandard2.0
working-directory: ./source
run: dotnet build Handlebars/Handlebars.csproj -c Release -f netstandard2.0
- name: Build netstandard1.3
working-directory: ./source
run: dotnet build Handlebars/Handlebars.csproj -c Release -f netstandard1.3
- name: Build net452
working-directory: ./source
run: dotnet build Handlebars/Handlebars.csproj -c Release -f net452

test-windows:
runs-on: windows-latest
needs: [build]
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.806
- name: Test
working-directory: ./source
run: dotnet test ./Handlebars.Test/Handlebars.Test.csproj -f netcoreapp2.1 --logger:trx

test-linux:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.806
- name: Test
working-directory: ./source
run: dotnet test ./Handlebars.Test/Handlebars.Test.csproj -f netcoreapp2.1 --logger:trx

test-macos:
runs-on: macos-latest
needs: [build]
steps:
- uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.806
- name: Test
working-directory: ./source
run: dotnet test ./Handlebars.Test/Handlebars.Test.csproj -f netcoreapp2.1 --logger:trx

sonar-pr:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2
- name: Sonarscanner for dotnet
uses: Secbyte/dotnet-sonarscanner@v2.2
with:
buildCommand: dotnet build source/Handlebars/Handlebars.csproj -f netstandard2.0
testCommand: dotnet test source/Handlebars.Test/Handlebars.Test.csproj -f netcoreapp2.1 --logger:trx --collect:"XPlat Code Coverage" --settings source/Handlebars.Test/coverlet.runsettings
projectKey: zjklee_handlebars.csharp
projectName: handlebars.csharp
sonarOrganisation: zjklee
beginArguments: >
/d:sonar.verbose="true"
/d:sonar.cs.opencover.reportsPaths="**/*.opencover.xml"
/d:sonar.cs.vstest.reportsPaths="**/*.trx"
/d:sonar.coverage.exclusions="**/*.md"
/d:sonar.pullrequest.key=${{ github.event.number }}
/d:sonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
/d:sonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
env:
SONAR_TOKEN: 0a2d91d681b618b29a293e3d1e7e1e9ea82710a2
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

138 changes: 138 additions & 0 deletions Performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#Performance

### Setup

#### Template

```handlebars
childCount={{level1.Count}}
childCount2={{level1.Count}}
{{#each level1}}
id={{id}}
childCount={{level2.Count}}
childCount2={{level2.Count}}
index=[{{@../../index}}:{{@../index}}:{{@index}}]
first=[{{@../../first}}:{{@../first}}:{{@first}}]
last=[{{@../../last}}:{{@../last}}:{{@last}}]
{{#each level2}}
id={{id}}
childCount={{level3.Count}}
childCount2={{level3.Count}}
index=[{{@../../index}}:{{@../index}}:{{@index}}]
first=[{{@../../first}}:{{@../first}}:{{@first}}]
last=[{{@../../last}}:{{@../last}}:{{@last}}]
{{#each level3}}
id={{id}}
index=[{{@../../index}}:{{@../index}}:{{@index}}]
first=[{{@../../first}}:{{@../first}}:{{@first}}]
last=[{{@../../last}}:{{@../last}}:{{@last}}]
{{/each}}
{{/each}}
{{/each}}
```

#### Input example

```json
{
"level1": [
{
"id": "0",
"level2": [
{
"id": "0-0",
"level3": [
{
"id": "0-0-0"
}
]
}
]
}
]
}
```

#### Environment

``` ini

BenchmarkDotNet=v0.12.0, OS=Windows 10.0.17763.973 (1809/October2018Update/Redstone5), VM=Hyper-V
Intel Xeon CPU E5-2640 v3 2.60GHz, 1 CPU, 16 logical and 16 physical cores
.NET Core SDK=3.1.100
[Host] : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), X64 RyuJIT
Job-GBTPJU : .NET Core 3.1.0 (CoreCLR 4.700.19.56402, CoreFX 4.700.19.56404), X64 RyuJIT

Runtime=.NET Core 3.1

```

#### Legend

##### Version
`1.10.1` - Handlebars.Net version

`current` - current handlebars.csharp version

`current-cache` - current handlebars.csharp version with aggressive caching (`Default`)

`current-fast` - current handlebars.csharp version with `CompileFast` feature

`current-fast-cache` - current handlebars.csharp version with `CompileFast` feature and aggressive caching

##### N

Number of items on each level of the input.

### Results

#### Compilation

| Method | Version | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|--------- |------------- |----------:|----------:|----------:|---------:|---------:|------:|----------:|
| **Template** | **1.10.1** | **26.270 ms** | **0.4970 ms** | **0.4406 ms** | **375.0000** | **187.5000** | **-** | **3900.8 KB** |
| **Template** | **current** | **13.723 ms** | **0.2681 ms** | **0.2238 ms** | **62.5000** | **31.2500** | **-** | **735.62 KB** |
| **Template** | **current-fast** | **3.078 ms** | **0.0615 ms** | **0.0862 ms** | **78.1250** | **39.0625** | **-** | **804.66 KB** |

#### Execution

| Method | N | Version | DataType | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---------------- |--- |------------------- |----------- |-------------:|-----------:|-----------:|---------:|---------:|---------:|-----------:|
| **WithParentIndex** | **2** | **1.10.1** | **dictionary** | **385.33 us** | **6.026 us** | **5.342 us** | **11.7188** | **0.4883** | **-** | **120.58 KB** |
| **WithParentIndex** | **2** | **1.10.1** | **object** | **363.27 us** | **7.111 us** | **6.984 us** | **9.7656** | **0.4883** | **-** | **102.74 KB** |
| **WithParentIndex** | **2** | **current** | **dictionary** | **49.35 us** | **0.973 us** | **1.396 us** | **1.0376** | **-** | **-** | **11.19 KB** |
| **WithParentIndex** | **2** | **current** | **object** | **63.92 us** | **1.221 us** | **1.454 us** | **1.0986** | **-** | **-** | **11.61 KB** |
| **WithParentIndex** | **2** | **current-cache** | **dictionary** | **45.84 us** | **0.810 us** | **0.718 us** | **1.0376** | **-** | **-** | **11.19 KB** |
| **WithParentIndex** | **2** | **current-cache** | **object** | **54.90 us** | **1.509 us** | **1.338 us** | **1.0986** | **-** | **-** | **11.61 KB** |
| **WithParentIndex** | **2** | **current-fast** | **dictionary** | **52.31 us** | **1.005 us** | **1.307 us** | **1.0376** | **-** | **-** | **11.19 KB** |
| **WithParentIndex** | **2** | **current-fast** | **object** | **64.17 us** | **1.238 us** | **1.325 us** | **1.0986** | **-** | **-** | **11.61 KB** |
| **WithParentIndex** | **2** | **current-fast-cache** | **dictionary** | **43.94 us** | **0.863 us** | **0.765 us** | **1.0376** | **-** | **-** | **11.19 KB** |
| **WithParentIndex** | **2** | **current-fast-cache** | **object** | **53.77 us** | **0.840 us** | **0.744 us** | **1.0986** | **-** | **-** | **11.61 KB** |


| Method | N | Version | DataType | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---------------- |--- |------------------- |----------- |-------------:|-----------:|-----------:|---------:|---------:|---------:|-----------:|
| **WithParentIndex** | **5** | **1.10.1** | **dictionary** | **3,436.11 us** | **68.128 us** | **88.585 us** | **101.5625** | **23.4375** | **-** | **1111.08 KB** |
| **WithParentIndex** | **5** | **1.10.1** | **object** | **3,492.48 us** | **68.605 us** | **93.907 us** | **93.7500** | **23.4375** | **-** | **1002.9 KB** |
| **WithParentIndex** | **5** | **current** | **dictionary** | **369.02 us** | **7.016 us** | **6.563 us** | **9.7656** | **1.4648** | **-** | **103.43 KB** |
| **WithParentIndex** | **5** | **current** | **object** | **496.41 us** | **9.794 us** | **14.659 us** | **9.7656** | **0.9766** | **-** | **105.54 KB** |
| **WithParentIndex** | **5** | **current-cache** | **dictionary** | **356.12 us** | **6.967 us** | **7.744 us** | **9.7656** | **1.4648** | **-** | **103.43 KB** |
| **WithParentIndex** | **5** | **current-cache** | **object** | **418.22 us** | **7.863 us** | **8.075 us** | **10.2539** | **1.4648** | **-** | **105.54 KB** |
| **WithParentIndex** | **5** | **current-fast** | **dictionary** | **375.19 us** | **6.064 us** | **5.672 us** | **9.7656** | **1.4648** | **-** | **103.43 KB** |
| **WithParentIndex** | **5** | **current-fast** | **object** | **479.95 us** | **9.304 us** | **8.248 us** | **9.7656** | **0.9766** | **-** | **105.54 KB** |
| **WithParentIndex** | **5** | **current-fast-cache** | **dictionary** | **350.70 us** | **7.537 us** | **7.050 us** | **9.7656** | **1.4648** | **-** | **103.43 KB** |
| **WithParentIndex** | **5** | **current-fast-cache** | **object** | **403.11 us** | **6.821 us** | **6.381 us** | **10.2539** | **1.4648** | **-** | **105.54 KB** |


| Method | N | Version | DataType | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---------------- |--- |------------------- |----------- |-------------:|-----------:|-----------:|---------:|---------:|---------:|-----------:|
| **WithParentIndex** | **10** | **1.10.1** | **dictionary** | **25,667.09 us** | **572.214 us** | **723.667 us** | **687.5000** | **250.0000** | **93.7500** | **7482.11 KB** |
| **WithParentIndex** | **10** | **1.10.1** | **object** | **22,741.41 us** | **437.277 us** | **486.033 us** | **656.2500** | **218.7500** | **125.0000** | **6919.99 KB** |
| **WithParentIndex** | **10** | **current** | **dictionary** | **2,513.83 us** | **50.250 us** | **53.767 us** | **136.7188** | **109.3750** | **109.3750** | **701.46 KB** |
| **WithParentIndex** | **10** | **current** | **object** | **2,827.85 us** | **55.088 us** | **77.226 us** | **136.7188** | **109.3750** | **109.3750** | **709.18 KB** |
| **WithParentIndex** | **10** | **current-cache** | **dictionary** | **2,203.95 us** | **43.770 us** | **48.650 us** | **136.7188** | **109.3750** | **109.3750** | **701.43 KB** |
| **WithParentIndex** | **10** | **current-cache** | **object** | **2,530.40 us** | **49.594 us** | **81.485 us** | **136.7188** | **109.3750** | **109.3750** | **709.24 KB** |
| **WithParentIndex** | **10** | **current-fast** | **dictionary** | **2,264.14 us** | **45.091 us** | **83.578 us** | **136.7188** | **109.3750** | **109.3750** | **701.53 KB** |
| **WithParentIndex** | **10** | **current-fast** | **object** | **2,906.42 us** | **57.859 us** | **91.770 us** | **136.7188** | **109.3750** | **109.3750** | **709.22 KB** |
| **WithParentIndex** | **10** | **current-fast-cache** | **dictionary** | **2,164.81 us** | **40.893 us** | **45.452 us** | **136.7188** | **109.3750** | **109.3750** | **701.49 KB** |
| **WithParentIndex** | **10** | **current-fast-cache** | **object** | **2,497.93 us** | **49.739 us** | **88.412 us** | **136.7188** | **109.3750** | **109.3750** | **709.18 KB** |
Loading