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

♻️ Extract and share code computing safe versions for built-ins #3109

Merged
merged 5 commits into from
Sep 2, 2022

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Sep 1, 2022

Category:

  • ✨ Introduce new features
  • 📝 Add or update documentation
  • ✅ Add or update tests
  • 🐛 Fix a bug
  • 🏷️ Add or update types
  • ⚡️ Improve performance
  • Other(s): ...

Potential impacts:

  • Generated values
  • Shrink values
  • Performance
  • Typings
  • Other(s): ...

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 2, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5b29210:

Sandbox Source
Vanilla Configuration
@fast-check/examples Configuration

@dubzzz dubzzz changed the title ♻️ Simplify code extracting globals ♻️ Extract and share code computing safe versions for built-ins Sep 2, 2022
@dubzzz
Copy link
Owner Author

dubzzz commented Sep 2, 2022

Performance test running at: https://github.com/dubzzz/fast-check-benchmarks/actions/runs/2981007183

Algorithm;3.1.0;main;extra
Property(fc.boolean());6378.154522626851;5639.301967085505;5865.992325167713
Property(fc.integer());6419.586549112095;6032.76987744079;5933.1140140195375
Property(fc.maxSafeInteger());6295.589288714306;5778.528447716371;5819.9681220429975
Property(fc.float());6009.064272394641;5557.667227587442;5656.960193504944
Property(fc.double());4770.23483154127;4503.041346068629;4474.45442171608
Property(fc.bigInt());2019.1079228332865;1962.6728064996971;1930.5430764666783
Property(fc.char());6212.890695410312;5737.252611157939;5734.55245897637
Property(fc.string());3398.535196532544;2767.44088353785;2724.34306871335
Property(fc.string({ minLength: 0, maxLength: 500, size: 'max' }));213.88115582946577;142.50541144625367;140.90792388299053
Property(fc.string({ minLength: 0, maxLength: 25_000, size: 'max' }));3.3253597552297802;2.2083182959187164;2.2209720327875377
Property(fc.array(fc.integer()));4394.725622922178;3535.8635164607144;3494.607758992592
Property(fc.array(fc.integer(), { minLength: 0, maxLength: 500, size: 'max' }));336.6223912521767;201.9368435204583;200.91118074855217
Property(fc.array(fc.integer(), { minLength: 0, maxLength: 25_000, size: 'max' }));5.644338417094247;3.4453279306974203;3.4135677686312356
Property(fc.uniqueArray(fc.integer()));3911.503129846511;3142.311461122663;3138.8289872540295
Property(fc.uniqueArray(fc.integer(), { minLength: 0, maxLength: 500, size:'max' }));222.56436339651847;138.14199079009478;137.9750086781266
Property(fc.anything());352.1343622356834;301.1438580900471;305.46988880088037
Property(fc.constant('a'));7027.265880307328;6294.699403287688;6404.567175177081
Property(fc.constantFrom('a', 'b', 'c'));7015.542916436568;6237.907980265936;6297.427570457231
Property(fc.option(fc.integer()));6085.38201838127;5668.8017135107575;5758.497667220072
Property(fc.oneof(fc.ascii(), fc.hexa()));5803.920433952585;5491.370896298625;5385.911808128638
Property(fc.oneof(fc.ascii()@w=1, fc.hexa()@w=2));5807.707815380785;5505.698932612241;5489.335291556191
Property(fc.tuple(fc.ascii(), fc.hexa()));5020.142636099578;4404.444798228335;4261.881912599286
Property(fc.record({ascii: fc.ascii(), hexa: fc.hexa()}));4499.655857406277;3064.0550964230806;3016.8225342529436
Property();3588.8901632212637;3023.797043583628;3017.830813362127
Property();1963.9702028991312;1630.148358500709;1586.3730330595158
Property(fc.emailAddress());57.319400319812324;55.10406736808202;54.66591650363297
Property(fc.webUrl());107.20426328548733;103.83738220337914;100.17884775922917
Property(fc.integer().filter(() => true));6463.540542446902;5992.348105802597;5800.257974751986
Property(fc.integer().map(n => n));6189.918280336492;5945.652159834109;5959.522231026696
Property(fc.integer().chain(() => fc.integer()));5576.749893154355;5525.415019502786;5463.3393919812315
Property(fc.integer().noBias());6917.748528400249;6133.750634570315;6429.527759487678
Property(fc.integer().noShrink());6438.660657912117;6079.978569086936;6108.671202056146

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.

None yet

1 participant