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

Optimise valid?/2 #66

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

gesta
Copy link

@gesta gesta commented Apr 9, 2020

Fixes #65

Benchmarks:
50 runs for each implementation consisting of ~90 000 checks per run.
Results are in microseconds.
TL;DR: 2sec for valid?/2, ~50sec for conform/2.

valid? conform
2012468 52446747
1958767 49930423
1981143 50477395
2005227 50175413
1996278 50631595
2015621 53384663
1962915 51014405
2057126 50375344
1960135 50951396
1963531 50061197
1929721 50220423
1948214 49930450
1952217 49802433
1997368 49696173
1967032 50046508
1972836 49406972
1938450 49817945
1959891 49687747
1961860 49447045
1956255 49610711
1997596 49249689
1951382 49329118
2012229 49438534
1937561 49320431
1920401 49417229
1932584 50215488
1932026 50173875
1908881 50565533
1917214 50346232
1915676 50206065
1961261 49412046
1925107 49344110
1926179 49652765
1903635 49788570
1983483 49258780
1981491 49438113
1997598 57861646
1967174 57654857
2037674 58126992
1965466 57942112
1951443 58370191
1952561 58220536
1944028 58091247
1960469 58051644
1942835 49605340
1966198 49329768
1977263 49310646
1967109 49470729
1938717 49455685
1962793 49598098
implementation min max mean
valid? 1903635 2057126 1962701.78
conform 49249689 58370191 51267221.08

@keathley
Copy link
Member

Thanks @gesta! This looks really interesting. I think this seems like a good thing to support but I want to think through all of the implications for just a bit before we decide to go in this direction :).

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.

Norm.valid?/2 becomes prohibitively slower after a certain amount of records to validate
2 participants