diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..21943c337 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +charset = utf-8-bom +end_of_line = crlf +indent_style = space +trim_trailing_whitespace = true + +[*.cs] +indent_size = 4 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 1ff0c4230..0a2cec4b8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,63 +1,6 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### +# Auto detect text files and perform LF normalization +# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ * text=auto -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp +*.cs diff=csharp -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index a73c2738b..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '22 17 * * 4' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'csharp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..5691bbd89 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,62 @@ +name: Publish +# This job builds and and publishes the package to NuGet. +# It depends on the included tests job to complete successfully. +# The version number is determined by the latest tag for the 'main' branch selected with workflow dispatch. +on: + workflow_dispatch: {} + +jobs: + tests: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags and branches + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + 6.0.x + 3.1.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore --configuration Release -p:nowarn=1591 + - name: Test + run: dotnet test --no-build --configuration Release --verbosity quiet + + publish: + runs-on: ubuntu-latest + needs: tests + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags and branches + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Get version tag + # The latest tag for the selected branch. + # Get it and strip off any leading 'v' from the version tag + run: | + Version=$(git describe --tags --abbrev=0 | sed 's/^v//') + echo "VERSION=$Version" >> $GITHUB_ENV + echo "Version: $Version" + - name: Build and pack for publishing + run: | + dotnet restore + dotnet build --configuration Release Ical.Net/Ical.Net.csproj -p:Version=${{env.VERSION}} -p:FileVersion=${{env.VERSION}}.${{github.run_number}} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true + dotnet pack --configuration Release Ical.Net/Ical.Net.csproj -p:Version=${{env.VERSION}} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg --no-build -p:PackageVersion=${{env.VERSION}}.${{github.run_number}} -p:NuspecFile=Ical.Net.nuspec + - name: Store artifacts + uses: actions/upload-artifact@v4 + with: + name: ICal.Net_pkg_${{env.VERSION}}.${{github.run_number}} + path: | + Ical.Net/bin/Release/**/*.nupkg + Ical.Net/bin/Release/**/*.snupkg + - name: Push package to NuGet + # Does not fail, if the package already exists + run: dotnet nuget push Ical.Net/bin/Release/Ical.Net.${{env.VERSION}}.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..137a393e7 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,34 @@ +name: Tests + +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags and branches + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + 6.0.x + 3.1.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore --configuration Release -p:nowarn=1591 + - name: Test + run: dotnet test --no-build --configuration Release --verbosity quiet diff --git a/.gitignore b/.gitignore index 28b8554eb..50854d3c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,15 @@ -## OS-specific files -.DS_Store -## Benchmark.net files -*.html -*.csv +# Created by https://www.gitignore.io/api/csharp +# Edit at https://www.gitignore.io/?templates=csharp +### Csharp ### ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files +*.rsuser *.suo *.user *.userosscache @@ -17,6 +18,9 @@ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs +# Mono auto generated files +mono_crash.* + # Build results [Dd]ebug/ [Dd]ebugPublic/ @@ -24,41 +28,57 @@ [Rr]eleases/ x64/ x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ -# Visual Studio 2015 cache/options directory +# Visual Studio 2015/2017 cache/options directory .vs/ +.vscode/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ +# Visual Studio 2017 auto generated files +Generated\ Files/ + # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -# NUNIT +# NUnit *.VisualState.xml TestResult.xml +nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c -# DNX +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core project.lock.json +project.fragment.lock.json artifacts/ +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio *_i.c *_p.c -*_i.h +*_h.h *.ilk -*.meta *.obj +*.iobj *.pch *.pdb +*.ipdb *.pgc *.pgd *.rsp @@ -68,6 +88,7 @@ artifacts/ *.tlh *.tmp *.tmp_proj +*_wpftmp.csproj *.log *.vspscc *.vssscc @@ -96,6 +117,9 @@ ipch/ *.vspx *.sap +# Visual Studio Trace Files +*.e2e + # TFS 2012 Local Workspace $tf/ @@ -116,6 +140,14 @@ _TeamCity* # DotCover is a Code Coverage Tool *.dotCover +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + # NCrunch _NCrunch_* .*crunch*.local.xml @@ -147,7 +179,7 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings +# Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj @@ -159,13 +191,15 @@ PublishScripts/ # NuGet Packages *.nupkg +# NuGet Symbol Packages +*.snupkg # The packages folder can be ignored because of Package Restore -**/packages/* +**/[Pp]ackages/* # except build/, which is used as an MSBuild target. -!**/packages/build/ +!**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets @@ -182,12 +216,15 @@ AppPackages/ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt +*.appx +*.appxbundle +*.appxupload # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache -!*.[Cc]ache/ +!?*.[Cc]ache/ # Others ClientBin/ @@ -195,11 +232,15 @@ ClientBin/ *~ *.dbmdl *.dbproj.schemaview +*.jfm *.pfx *.publishsettings -node_modules/ orleans.codegen.cs +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ @@ -214,15 +255,22 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak # SQL Server files *.mdf *.ldf +*.ndf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl # Microsoft Fakes FakesAssemblies/ @@ -232,6 +280,7 @@ FakesAssemblies/ # Node.js Tools for Visual Studio .ntvs_analysis.dat +node_modules/ # Visual Studio 6 build log *.plg @@ -239,6 +288,9 @@ FakesAssemblies/ # Visual Studio 6 workspace options file *.opt +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts @@ -254,6 +306,56 @@ paket-files/ # FAKE - F# Make .fake/ -# JetBrains Rider -.idea/ -*.sln.iml \ No newline at end of file +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Secrets +secrets.json +secrets.buildkey (edited) +appsettings.*.json + +# End of https://www.gitignore.io/api/csharp diff --git a/BenchmarkDotNet.Artifacts/results/BenchmarkRun-001-2017-11-25-04-26-12-report-github.md b/BenchmarkDotNet.Artifacts/results/BenchmarkRun-001-2017-11-25-04-26-12-report-github.md deleted file mode 100644 index 0137f2c9f..000000000 --- a/BenchmarkDotNet.Artifacts/results/BenchmarkRun-001-2017-11-25-04-26-12-report-github.md +++ /dev/null @@ -1,10 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.726) -Processor=Intel Core i5-3210M CPU 2.50GHz (Ivy Bridge), ProcessorCount=4 -Frequency=2435874 Hz, Resolution=410.5303 ns, Timer=TSC -.NET Core SDK=2.0.3 - [Host] : .NET Core 2.0.3 (Framework 4.6.25815.02), 64bit RyuJIT - -There are no benchmarks found - diff --git a/BenchmarkDotNet.Artifacts/results/PerfTests.CalDateTimePerfTests-report-github.md b/BenchmarkDotNet.Artifacts/results/PerfTests.CalDateTimePerfTests-report-github.md deleted file mode 100644 index 509fc1d45..000000000 --- a/BenchmarkDotNet.Artifacts/results/PerfTests.CalDateTimePerfTests-report-github.md +++ /dev/null @@ -1,18 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.726) -Processor=Intel Core i5-3210M CPU 2.50GHz (Ivy Bridge), ProcessorCount=4 -Frequency=2435874 Hz, Resolution=410.5303 ns, Timer=TSC -.NET Core SDK=2.0.3 - [Host] : .NET Core 2.0.3 (Framework 4.6.25815.02), 64bit RyuJIT - - -``` -| Method | Mean | Error | StdDev | Median | -|----------------------------- |-----------:|---------:|----------:|-----------:| -| EmptyTzid | 719.4 ns | 14.03 ns | 13.78 ns | 711.3 ns | -| SpecifiedTzid | 1,828.2 ns | 38.02 ns | 48.08 ns | 1,802.2 ns | -| UtcDateTime | 1,435.8 ns | 28.07 ns | 40.26 ns | 1,408.9 ns | -| EmptyTzidToTzid | 4,968.9 ns | 98.92 ns | 125.10 ns | 4,903.4 ns | -| SpecifiedTzidToDifferentTzid | 4,892.1 ns | 96.39 ns | 135.13 ns | 4,815.4 ns | -| UtcToDifferentTzid | 4,229.6 ns | 84.41 ns | 128.91 ns | 4,173.1 ns | diff --git a/BenchmarkDotNet.Artifacts/results/PerfTests.OccurencePerfTests-report-github.md b/BenchmarkDotNet.Artifacts/results/PerfTests.OccurencePerfTests-report-github.md deleted file mode 100644 index 0e50a10f8..000000000 --- a/BenchmarkDotNet.Artifacts/results/PerfTests.OccurencePerfTests-report-github.md +++ /dev/null @@ -1,18 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.726) -Processor=Intel Core i5-3210M CPU 2.50GHz (Ivy Bridge), ProcessorCount=4 -Frequency=2435874 Hz, Resolution=410.5303 ns, Timer=TSC -.NET Core SDK=2.0.3 - [Host] : .NET Core 2.0.3 (Framework 4.6.25815.02), 64bit RyuJIT - - -``` -| Method | Mean | Error | StdDev | -|----------------------------------------------------------- |------------:|----------:|----------:| -| MultipleEventsWithUntilOccurrencesSearchingByWholeCalendar | 1,483.1 us | 29.59 us | 37.43 us | -| MultipleEventsWithUntilOccurrences | 1,123.2 us | 21.72 us | 25.01 us | -| MultipleEventsWithUntilOccurrencesEventsAsParallel | 891.1 us | 17.73 us | 18.20 us | -| MultipleEventsWithCountOccurrencesSearchingByWholeCalendar | 14,174.4 us | 276.96 us | 284.42 us | -| MultipleEventsWithCountOccurrences | 9,314.6 us | 180.01 us | 227.66 us | -| MultipleEventsWithCountOccurrencesEventsAsParallel | 6,603.5 us | 130.28 us | 173.92 us | diff --git a/BenchmarkDotNet.Artifacts/results/PerfTests.SerializationPerfTests-report-github.md b/BenchmarkDotNet.Artifacts/results/PerfTests.SerializationPerfTests-report-github.md deleted file mode 100644 index 749030524..000000000 --- a/BenchmarkDotNet.Artifacts/results/PerfTests.SerializationPerfTests-report-github.md +++ /dev/null @@ -1,14 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.726) -Processor=Intel Core i5-3210M CPU 2.50GHz (Ivy Bridge), ProcessorCount=4 -Frequency=2435874 Hz, Resolution=410.5303 ns, Timer=TSC -.NET Core SDK=2.0.3 - [Host] : .NET Core 2.0.3 (Framework 4.6.25815.02), 64bit RyuJIT - - -``` -| Method | Mean | Error | StdDev | -|------------------ |----------:|-----------:|-----------:| -| Deserialize | 639.00 us | 12.6489 us | 15.9968 us | -| SerializeCalendar | 21.53 us | 0.4269 us | 0.5082 us | diff --git a/BenchmarkDotNet.Artifacts/results/PerfTests.ThroughputTests-report-github.md b/BenchmarkDotNet.Artifacts/results/PerfTests.ThroughputTests-report-github.md deleted file mode 100644 index c881ccdc5..000000000 --- a/BenchmarkDotNet.Artifacts/results/PerfTests.ThroughputTests-report-github.md +++ /dev/null @@ -1,14 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.726) -Processor=Intel Core i5-3210M CPU 2.50GHz (Ivy Bridge), ProcessorCount=4 -Frequency=2435874 Hz, Resolution=410.5303 ns, Timer=TSC -.NET Core SDK=2.0.3 - [Host] : .NET Core 2.0.3 (Framework 4.6.25815.02), 64bit RyuJIT - - -``` -| Method | Mean | Error | StdDev | Median | -|-------------------------------------- |---------:|----------:|----------:|---------:| -| DeserializeAndComputeUntilOccurrences | 18.97 ms | 0.3692 ms | 0.4534 ms | 18.78 ms | -| DeserializeAndComputeCountOccurrences | 18.98 ms | 0.3711 ms | 0.5778 ms | 18.65 ms | diff --git a/BenchmarkDotNet.Artifacts/v2/results/PerfTesting.CalDateTimePerfTests-report-github.md b/BenchmarkDotNet.Artifacts/v2/results/PerfTesting.CalDateTimePerfTests-report-github.md deleted file mode 100644 index a81352436..000000000 --- a/BenchmarkDotNet.Artifacts/v2/results/PerfTesting.CalDateTimePerfTests-report-github.md +++ /dev/null @@ -1,17 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.726) -Processor=Intel Core i5-3210M CPU 2.50GHz (Ivy Bridge), ProcessorCount=4 -Frequency=2435874 Hz, Resolution=410.5303 ns, Timer=TSC - [Host] : .NET Framework 4.6.2 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2115.0 - - -``` -| Method | Mean | Error | StdDev | -|----------------------------- |-----------:|---------:|----------:| -| EmptyTzid | 1,400.0 ns | 27.41 ns | 25.64 ns | -| SpecifiedTzid | 2,043.0 ns | 40.73 ns | 60.97 ns | -| UtcDateTime | 961.3 ns | 19.29 ns | 27.04 ns | -| EmptyTzidToTzid | 4,002.6 ns | 78.20 ns | 114.62 ns | -| SpecifiedTzidToDifferentTzid | 5,007.1 ns | 97.24 ns | 139.46 ns | -| UtcToDifferentTzid | 3,654.3 ns | 71.20 ns | 84.76 ns | diff --git a/BenchmarkDotNet.Artifacts/v2/results/PerfTesting.OccurencePerfTests-report-github.md b/BenchmarkDotNet.Artifacts/v2/results/PerfTesting.OccurencePerfTests-report-github.md deleted file mode 100644 index ab30587cb..000000000 --- a/BenchmarkDotNet.Artifacts/v2/results/PerfTesting.OccurencePerfTests-report-github.md +++ /dev/null @@ -1,17 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.726) -Processor=Intel Core i5-3210M CPU 2.50GHz (Ivy Bridge), ProcessorCount=4 -Frequency=2435874 Hz, Resolution=410.5303 ns, Timer=TSC - [Host] : .NET Framework 4.6.2 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2115.0 - - -``` -| Method | Mean | Error | StdDev | -|----------------------------------------------------------- |----------:|----------:|----------:| -| MultipleEventsWithUntilOccurrencesSearchingByWholeCalendar | 2.225 ms | 0.0438 ms | 0.0732 ms | -| MultipleEventsWithUntilOccurrences | 1.625 ms | 0.0324 ms | 0.0360 ms | -| MultipleEventsWithUntilOccurrencesEventsAsParallel | 1.210 ms | 0.0248 ms | 0.0295 ms | -| MultipleEventsWithCountOccurrencesSearchingByWholeCalendar | 19.753 ms | 0.3860 ms | 0.5283 ms | -| MultipleEventsWithCountOccurrences | 14.173 ms | 0.2756 ms | 0.3486 ms | -| MultipleEventsWithCountOccurrencesEventsAsParallel | 9.230 ms | 0.0966 ms | 0.0806 ms | diff --git a/BenchmarkDotNet.Artifacts/v2/results/PerfTesting.SerializationPerfTests-report-github.md b/BenchmarkDotNet.Artifacts/v2/results/PerfTesting.SerializationPerfTests-report-github.md deleted file mode 100644 index a0b946c39..000000000 --- a/BenchmarkDotNet.Artifacts/v2/results/PerfTesting.SerializationPerfTests-report-github.md +++ /dev/null @@ -1,13 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.726) -Processor=Intel Core i5-3210M CPU 2.50GHz (Ivy Bridge), ProcessorCount=4 -Frequency=2435874 Hz, Resolution=410.5303 ns, Timer=TSC - [Host] : .NET Framework 4.6.2 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2115.0 - - -``` -| Method | Mean | Error | StdDev | -|------------------ |------------:|-----------:|-----------:| -| Deserialize | 1,054.21 us | 23.7054 us | 40.2535 us | -| SerializeCalendar | 22.43 us | 0.4281 us | 0.5258 us | diff --git a/src/PerfTests/ApplicationWorkflows.cs b/Ical.Net.Benchmarks/ApplicationWorkflows.cs similarity index 96% rename from src/PerfTests/ApplicationWorkflows.cs rename to Ical.Net.Benchmarks/ApplicationWorkflows.cs index abb082a79..b80990d82 100644 --- a/src/PerfTests/ApplicationWorkflows.cs +++ b/Ical.Net.Benchmarks/ApplicationWorkflows.cs @@ -1,13 +1,12 @@ -using System; +using BenchmarkDotNet.Attributes; +using Ical.Net.DataTypes; +using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; -using BenchmarkDotNet.Attributes; -using Ical.Net; -using Ical.Net.DataTypes; -namespace PerfTests +namespace Ical.Net.Benchmarks { public class ApplicationWorkflows { diff --git a/src/PerfTests/CalDateTimePerfTests.cs b/Ical.Net.Benchmarks/CalDateTimePerfTests.cs similarity index 90% rename from src/PerfTests/CalDateTimePerfTests.cs rename to Ical.Net.Benchmarks/CalDateTimePerfTests.cs index 842ae8af9..4377f8112 100644 --- a/src/PerfTests/CalDateTimePerfTests.cs +++ b/Ical.Net.Benchmarks/CalDateTimePerfTests.cs @@ -1,8 +1,8 @@ -using System; -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using Ical.Net.DataTypes; +using System; -namespace PerfTests +namespace Ical.Net.Benchmarks { public class CalDateTimePerfTests { diff --git a/src/PerfTests/PerfTests.csproj b/Ical.Net.Benchmarks/Ical.Net.Benchmarks.csproj similarity index 54% rename from src/PerfTests/PerfTests.csproj rename to Ical.Net.Benchmarks/Ical.Net.Benchmarks.csproj index 0f31f9dc1..46ba15709 100644 --- a/src/PerfTests/PerfTests.csproj +++ b/Ical.Net.Benchmarks/Ical.Net.Benchmarks.csproj @@ -1,12 +1,12 @@ - + + net8.0;net6.0;netcoreapp3.1;net48 Exe - netcoreapp3.1;net50 - + diff --git a/src/PerfTests/OccurencePerfTests.cs b/Ical.Net.Benchmarks/OccurencePerfTests.cs similarity index 92% rename from src/PerfTests/OccurencePerfTests.cs rename to Ical.Net.Benchmarks/OccurencePerfTests.cs index 1fb1f5bfe..cfbe4c9cc 100644 --- a/src/PerfTests/OccurencePerfTests.cs +++ b/Ical.Net.Benchmarks/OccurencePerfTests.cs @@ -1,12 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using BenchmarkDotNet.Attributes; -using Ical.Net; +using BenchmarkDotNet.Attributes; using Ical.Net.CalendarComponents; using Ical.Net.DataTypes; +using System; +using System.Collections.Generic; +using System.Linq; -namespace PerfTests +namespace Ical.Net.Benchmarks { public class OccurencePerfTests { @@ -16,7 +15,7 @@ public void MultipleEventsWithUntilOccurrencesSearchingByWholeCalendar() var calendar = GetFourCalendarEventsWithUntilRule(); var searchStart = calendar.Events.First().DtStart.AddYears(-1); var searchEnd = calendar.Events.Last().DtStart.AddYears(1); - var occurences = calendar.GetOccurrences(searchStart, searchEnd); + _ = calendar.GetOccurrences(searchStart, searchEnd); } [Benchmark] @@ -25,7 +24,7 @@ public void MultipleEventsWithUntilOccurrences() var calendar = GetFourCalendarEventsWithUntilRule(); var searchStart = calendar.Events.First().DtStart.AddYears(-1); var searchEnd = calendar.Events.Last().DtStart.AddYears(1); - var eventOccurrences = calendar.Events + _ = calendar.Events .SelectMany(e => e.GetOccurrences(searchStart, searchEnd)) .ToList(); } @@ -36,7 +35,7 @@ public void MultipleEventsWithUntilOccurrencesEventsAsParallel() var calendar = GetFourCalendarEventsWithUntilRule(); var searchStart = calendar.Events.First().DtStart.AddYears(-1); var searchEnd = calendar.Events.Last().DtStart.AddYears(1).AddDays(10); - var eventOccurrences = calendar.Events + _ = calendar.Events .AsParallel() .SelectMany(e => e.GetOccurrences(searchStart, searchEnd)) .ToList(); @@ -80,7 +79,7 @@ public void MultipleEventsWithCountOccurrencesSearchingByWholeCalendar() var calendar = GetFourCalendarEventsWithCountRule(); var searchStart = calendar.Events.First().DtStart.AddYears(-1); var searchEnd = calendar.Events.Last().DtStart.AddYears(1); - var occurences = calendar.GetOccurrences(searchStart, searchEnd); + _ = calendar.GetOccurrences(searchStart, searchEnd); } [Benchmark] @@ -89,7 +88,7 @@ public void MultipleEventsWithCountOccurrences() var calendar = GetFourCalendarEventsWithCountRule(); var searchStart = calendar.Events.First().DtStart.AddYears(-1); var searchEnd = calendar.Events.Last().DtStart.AddYears(1); - var eventOccurrences = calendar.Events + _ = calendar.Events .SelectMany(e => e.GetOccurrences(searchStart, searchEnd)) .ToList(); } diff --git a/src/PerfTests/Runner.cs b/Ical.Net.Benchmarks/Runner.cs similarity index 77% rename from src/PerfTests/Runner.cs rename to Ical.Net.Benchmarks/Runner.cs index 358fe9bfd..0a27e12b9 100644 --- a/src/PerfTests/Runner.cs +++ b/Ical.Net.Benchmarks/Runner.cs @@ -1,15 +1,10 @@ -using System; -using System.IO; -using System.Linq; -using System.Reflection; -using BenchmarkDotNet.Running; -using BenchmarkDotNet.Toolchains.InProcess; +using BenchmarkDotNet.Running; -namespace PerfTests +namespace Ical.Net.Benchmarks { public class Runner { - static void Main(string[] args) + private static void Main(string[] args) { BenchmarkRunner.Run(BenchmarkConverter.TypeToBenchmarks(typeof(ApplicationWorkflows))); diff --git a/src/PerfTests/SerializationPerfTests.cs b/Ical.Net.Benchmarks/SerializationPerfTests.cs similarity index 67% rename from src/PerfTests/SerializationPerfTests.cs rename to Ical.Net.Benchmarks/SerializationPerfTests.cs index 5b65ec176..16fcc4963 100644 --- a/src/PerfTests/SerializationPerfTests.cs +++ b/Ical.Net.Benchmarks/SerializationPerfTests.cs @@ -1,17 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using BenchmarkDotNet.Attributes; -using Ical.Net; +using BenchmarkDotNet.Attributes; using Ical.Net.CalendarComponents; using Ical.Net.DataTypes; using Ical.Net.Serialization; +using System; +using System.Collections.Generic; +using System.Linq; -namespace PerfTests +namespace Ical.Net.Benchmarks { public class SerializationPerfTests { - private const string _sampleEvent = @"BEGIN:VCALENDAR + private const string SampleEvent = @"BEGIN:VCALENDAR PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN VERSION:2.0 METHOD:PUBLISH @@ -64,29 +63,32 @@ rsion 08.00.0681.000"">\n\n\n\n