zenika-open-source / immutadot

immutadot is a JavaScript library to deal with nested immutable structures.
https://immutadot.zenika.com
MIT License
178 stars 5 forks source link

Improve curry performances #317

Closed nlepage closed 5 years ago

nlepage commented 5 years ago

Issue : fix #316

codecov-io commented 5 years ago

Codecov Report

Merging #317 into dev will increase coverage by 0.35%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #317      +/-   ##
==========================================
+ Coverage   96.81%   97.17%   +0.35%     
==========================================
  Files         107      107              
  Lines         377      425      +48     
==========================================
+ Hits          365      413      +48     
  Misses         12       12
Impacted Files Coverage Δ
packages/immutadot/src/core/curry.js 100% <100%> (ø) :arrow_up:
packages/immutadot/src/core/apply.js 59.09% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 044e06b...1d4558e. Read the comment docs.

nlepage commented 5 years ago

Some explanation: fixedArity's only purpose is performance. It might or might not truncate extra arguments. So no assumption should be made on whether extra arguments will or will not be truncated. To be honest, I tried implementing a consistent behavior (truncating args when fixedArity is true and all args are sent at once, using args.slice(0, arity)), but it had significant impact on performance...

nlepage commented 5 years ago

Results here: https://github.com/Zenika/immutadot/issues/299#issuecomment-443363082