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

Work optimization: typo model #72

Merged
merged 1 commit into from
Nov 10, 2021
Merged

Work optimization: typo model #72

merged 1 commit into from
Nov 10, 2021

Conversation

vkatsuba
Copy link
Collaborator

@vkatsuba vkatsuba commented Nov 8, 2021

1> timer:tc(sheldon, check, [base64:encode(crypto:strong_rand_bytes(100))]).
{14639,
 #{bazinga => <<"Too bad, I'll have a virgin Cuba Libre.">>,
   misspelled_words =>
       [#{candidates => [],line_number => 1,
          word =>
              "yq4crT65D8fC6M89BXcrWj6XNPPwZo9NWqtN8AUkJD7iYNfAJeUwIgY7kp1bFGZl8Na+/ZBzZk1gBlQkFrTGumirN9SuvwPADhkzecou1H7UfWaPSWGdkFbBK8fJAeDM1yIGZA=="}]}}
1> LongWord = base64:encode(crypto:strong_rand_bytes(100)).
<<"m4o4qFgAPW+eWhrvWb34qXo9oRJEei2jEigEcVbkeO0F6chyzSZeUu1FlPJ+FK4FAQKsDMStj06D7wAEcLbC7/VXsF0okLtd/bJ/QCVK0Q4EjKO3kXTO"...>>
2> [begin {T, _} = timer:tc(sheldon, check, [LongWord]), T end || _ <- lists:seq(1, 10)].
[3333,1443,1579,1323,1235,1215,1302,1273,1232,1201]
1> LongWord = base64:encode(crypto:strong_rand_bytes(100)).
2> [begin {T, _} = timer:tc(sheldon, check, [LongWord]), T end || _ <- lists:seq(1, 100)].
[2181,1756,689,484,471,510,480,451,444,424,416,426,438,400,
 459,453,429,432,477,435,402,419,398,408,372,440,646,634,420|...]
40> sheldon:check("spelFing is wrong, should suggest spelling among others").
#{bazinga =>
      <<"I know the real reason you never made progress with that idea. You thought of it September 22nd 2007. Two days l"...>>,
  misspelled_words =>
      [#{candidates =>
             ["speeling","speiling","spelding","spelling","sperling",
              "spieling"],
         line_number => 1,word => "spelFing"}]}
36> timer:tc(fun() -> [begin {T, _} = timer:tc(sheldon, check, [LongWord]), T end || _ <- lists:seq(1, 2000)] end).  
{1109351,
 [2955,2360,2285,2378,2998,2711,2743,2411,2547,2756,2681,
  2373,1683,2393,2229,1551,1532,1149,799,1541,1326,1130,877,
  1142,834,737,802|...]}

@vkatsuba vkatsuba marked this pull request as draft November 8, 2021 18:26
@vkatsuba vkatsuba added the WIP 🚧 Work In Progress label Nov 8, 2021
@vkatsuba vkatsuba linked an issue Nov 8, 2021 that may be closed by this pull request
@vkatsuba vkatsuba force-pushed the speed_up/2 branch 2 times, most recently from 01cc7e4 to 5740802 Compare November 9, 2021 19:11
Created simple typo model based on delete and linking approach.
This need for load all typos before sheldon will start.
The work of checking is speedup.
@vkatsuba vkatsuba changed the title Work optimization: part #2 Work optimization: typo model Nov 10, 2021
@vkatsuba vkatsuba removed the WIP 🚧 Work In Progress label Nov 10, 2021
@vkatsuba vkatsuba removed the request for review from elbrujohalcon November 10, 2021 13:17
@vkatsuba vkatsuba marked this pull request as ready for review November 10, 2021 13:18
@elbrujohalcon elbrujohalcon merged commit 8e0d4ee into main Nov 10, 2021
@elbrujohalcon elbrujohalcon deleted the speed_up/2 branch November 10, 2021 13:19
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.

Typo generator
2 participants