Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger has enum definitions to generate string enum consts #39

Merged
merged 1 commit into from
Jan 27, 2018

Conversation

tomlm
Copy link
Contributor

@tomlm tomlm commented Jan 27, 2018

This gets rid of a bunch of hand authored values! 👍

@tomlm tomlm merged commit 0f460c9 into master Jan 27, 2018
@cleemullins cleemullins deleted the fixmention branch January 31, 2018 20:14
drub0y pushed a commit that referenced this pull request May 22, 2018
Provides a more performant implementation of the `SanitizeKey` method
for both `AzureTableStorage` and `CosmosDbStorage`. The new
implementation is faster in all cases and, perhaps more importantly,
the new implementation allocates zero bytes in the case that there are
no illegal characters in the key and guarantees only a single
allocation in the case when there are bad characters.

Benchmarks:

``` ini

BenchmarkDotNet=v0.10.14, OS=Windows 10.0.17134
Intel Core i7-8650U CPU 1.90GHz (Kaby Lake R), 1 CPU, 8 logical and 4
physical cores
  [Host]     : .NET Framework 4.7.1 (CLR 4.0.30319.42000), 64bit
RyuJIT-v4.7.3101.0
  DefaultJob : .NET Framework 4.7.1 (CLR 4.0.30319.42000), 64bit
RyuJIT-v4.7.3101.0

```
|                Method |
                                         key |        Mean |      Error
|     StdDev | Scaled | ScaledSD |  Gen 0 | Allocated |
|----------------------
|-------------------------------------------------------------------------------------------

|------------:|-----------:|-----------:|-------:|---------:|-------:|----------:|
| **SanitizeKey_OPTIMIZED** |
                  **bad-key-!@#$%^&*()~/\><,.?';`~** |
**379.31 ns** |  **8.6554 ns** | **16.2569 ns** |   **0.63** |
**0.03** | **0.0873** |     **368 B** |
|  SanitizeKey_ORIGINAL |
              bad-key-!@#$%^&*()~/\><,.?';`~ |   604.43
ns | 11.9625 ns | 11.7487 ns |   1.00 |     0.00 | 0.0887 |     376 B |
|                       |
                                             |             |
|            |        |          |        |           |
| **SanitizeKey_OPTIMIZED** |
**bad-this-is-a-realllllllll\y-long-key-that-
you-probably-wouldn't-encounter//-in-the-wild#** | **1,040.62 ns**
| **15.5311 ns** | **14.5278 ns** |   **0.56** |     **0.01** |
**0.2079** |     **880 B** |
|  SanitizeKey_ORIGINAL | bad-this-is-a-realllllllll\y-long-key-that-
you-probably-wouldn't-encounter//-in-the-wild# | 1,851.81 ns |
7.5866 ns |  5.4856 ns |   1.00 |     0.00 | 0.1755 |     744 B |
|                       |
                                             |             |
|            |        |          |        |           |
| **SanitizeKey_OPTIMIZED** |
                                    **good-key-123** |    **26.44 ns**
|  **0.5314 ns** |  **0.4437 ns** |   **0.11** |     **0.00** |
**-** |       **0 B** |
|  SanitizeKey_ORIGINAL |
                                good-key-123 |   242.83 ns |  4.9347 ns
| 10.5163 ns |   1.00 |     0.00 | 0.0358 |     152 B |
|                       |
                                             |             |
|            |        |          |        |           |
| **SanitizeKey_OPTIMIZED** |
**good-this-is-a-reallllllllly-long-key-that-you-probably-wouldnt-encounter-in-the-wild#**
 |   **349.20 ns** |  **6.5568 ns** |  **5.8124 ns** |   **0.20** |
**0.01** | **0.1101** |     **464 B** |
|  SanitizeKey_ORIGINAL |
good-this-is-a-reallllllllly-long-key-that-you-probably-wouldnt-encounter-in-the-wild#
 | 1,778.14 ns | 37.4411 ns | 72.1362 ns |   1.00 |     0.00 | 0.1659 |
    704 B |
tomlm pushed a commit that referenced this pull request Nov 27, 2018
Provides a more performant implementation of the `SanitizeKey` method
for both `AzureTableStorage` and `CosmosDbStorage`. The new
implementation is faster in all cases and, perhaps more importantly,
the new implementation allocates zero bytes in the case that there are
no illegal characters in the key and guarantees only a single
allocation in the case when there are bad characters.

Benchmarks:

``` ini

BenchmarkDotNet=v0.10.14, OS=Windows 10.0.17134
Intel Core i7-8650U CPU 1.90GHz (Kaby Lake R), 1 CPU, 8 logical and 4
physical cores
  [Host]     : .NET Framework 4.7.1 (CLR 4.0.30319.42000), 64bit
RyuJIT-v4.7.3101.0
  DefaultJob : .NET Framework 4.7.1 (CLR 4.0.30319.42000), 64bit
RyuJIT-v4.7.3101.0

```
|                Method |
                                         key |        Mean |      Error
|     StdDev | Scaled | ScaledSD |  Gen 0 | Allocated |
|----------------------
|-------------------------------------------------------------------------------------------

|------------:|-----------:|-----------:|-------:|---------:|-------:|----------:|
| **SanitizeKey_OPTIMIZED** |
                  **bad-key-!@#$%^&*()~/\><,.?';`~** |
**379.31 ns** |  **8.6554 ns** | **16.2569 ns** |   **0.63** |
**0.03** | **0.0873** |     **368 B** |
|  SanitizeKey_ORIGINAL |
              bad-key-!@#$%^&*()~/\><,.?';`~ |   604.43
ns | 11.9625 ns | 11.7487 ns |   1.00 |     0.00 | 0.0887 |     376 B |
|                       |
                                             |             |
|            |        |          |        |           |
| **SanitizeKey_OPTIMIZED** |
**bad-this-is-a-realllllllll\y-long-key-that-
you-probably-wouldn't-encounter//-in-the-wild#** | **1,040.62 ns**
| **15.5311 ns** | **14.5278 ns** |   **0.56** |     **0.01** |
**0.2079** |     **880 B** |
|  SanitizeKey_ORIGINAL | bad-this-is-a-realllllllll\y-long-key-that-
you-probably-wouldn't-encounter//-in-the-wild# | 1,851.81 ns |
7.5866 ns |  5.4856 ns |   1.00 |     0.00 | 0.1755 |     744 B |
|                       |
                                             |             |
|            |        |          |        |           |
| **SanitizeKey_OPTIMIZED** |
                                    **good-key-123** |    **26.44 ns**
|  **0.5314 ns** |  **0.4437 ns** |   **0.11** |     **0.00** |
**-** |       **0 B** |
|  SanitizeKey_ORIGINAL |
                                good-key-123 |   242.83 ns |  4.9347 ns
| 10.5163 ns |   1.00 |     0.00 | 0.0358 |     152 B |
|                       |
                                             |             |
|            |        |          |        |           |
| **SanitizeKey_OPTIMIZED** |
**good-this-is-a-reallllllllly-long-key-that-you-probably-wouldnt-encounter-in-the-wild#**
 |   **349.20 ns** |  **6.5568 ns** |  **5.8124 ns** |   **0.20** |
**0.01** | **0.1101** |     **464 B** |
|  SanitizeKey_ORIGINAL |
good-this-is-a-reallllllllly-long-key-that-you-probably-wouldnt-encounter-in-the-wild#
 | 1,778.14 ns | 37.4411 ns | 72.1362 ns |   1.00 |     0.00 | 0.1659 |
    704 B |
ShYuPe pushed a commit to ShYuPe/botbuilder-dotnet that referenced this pull request Aug 25, 2020
Update README.md to fix capitalization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant