Skip to content

Commit

Permalink
Improved performance using readonly, records, ref, and structs.
Browse files Browse the repository at this point in the history
  • Loading branch information
uncheckederror committed Nov 5, 2024
1 parent 8df8fd8 commit 27b0af8
Show file tree
Hide file tree
Showing 4 changed files with 440 additions and 573 deletions.
12 changes: 6 additions & 6 deletions PhoneNumbersNA.Benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
public class Data
{
// https://nationalnanpa.com/contact_us/NANP_Country_Contacts.pdf
readonly string[] NANPContactsSmall = new string[]
{
readonly string[] NANPContactsSmall =
[
"264 497-2651", "264-497-3651", "268- 468-4616", "242-393-0234",
"242-393-0153", "246- 535-2502", "441-405-6000", "441-474-6048",
"284-468-2183", "284-468-3090", "284-468-4165", "284-494- 6786",
Expand All @@ -27,10 +27,10 @@ public class Data
"784-457-2279","784-457-2834","868-675-8288","868-674-1055",
"649-946-1900","649-946-1119","202-418-1500","202-418-2825",
"202-418-1525","202-418-1413","925-420-0340","571-363-3838",
};
];

readonly string[] NANPContactsLarge = new string[]
{
readonly string[] NANPContactsLarge =
[
"264 497-2651", "264-497-3651", "268- 468-4616", "242-393-0234",
"242-393-0153", "246- 535-2502", "441-405-6000", "441-474-6048",
"284-468-2183", "284-468-3090", "284-468-4165", "284-494- 6786",
Expand Down Expand Up @@ -161,7 +161,7 @@ public class Data
"784-457-2279","784-457-2834","868-675-8288","868-674-1055",
"649-946-1900","649-946-1119","202-418-1500","202-418-2825",
"202-418-1525","202-418-1413","925-420-0340","571-363-3838",
};
];

readonly string NANPContactsStringSmall =
"264 497-2651,264-497-3651,268- 468-4616,242-393-0234," +
Expand Down
Loading

0 comments on commit 27b0af8

Please sign in to comment.