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

Add fast-clone to benchmark #6

Open
niftylettuce opened this issue Jun 11, 2019 · 6 comments
Open

Add fast-clone to benchmark #6

niftylettuce opened this issue Jun 11, 2019 · 6 comments

Comments

@niftylettuce
Copy link

λ ~/Projects/rfdc/ master* npm run bench

> rfdc@1.1.4 bench /Users/jack/Projects/rfdc
> node benchmark

benchDeepCopy*100: 748.877ms
benchLodashCloneDeep*100: 1893.592ms
benchFastClone*100: 3946.849ms
benchFastCopy*100: 1056.753ms
benchRfdc*100: 427.176ms
benchRfdcProto*100: 435.255ms
benchRfdcCircles*100: 490.022ms
benchRfdcCirclesProto*100: 487.759ms
benchDeepCopy*100: 750.964ms
benchLodashCloneDeep*100: 1955.513ms
benchFastClone*100: 4271.341ms
benchFastCopy*100: 1088.407ms
benchRfdc*100: 528.183ms
benchRfdcProto*100: 529.741ms
benchRfdcCircles*100: 497.151ms
benchRfdcCirclesProto*100: 486.490ms

Ref:

@codeandcats
Copy link

Hi @davidmarkclements, I wouldn't bother adding fast-clone to the benchmark. As I mentioned in the referenced issue, I wrote that library a few years ago and while it was the fastest I could find at the time, other libraries have since improved and overtaken it (such as your own). I don't have time to optimise/enhance it further so I'll most likely depreciate it.

@davidmarkclements
Copy link
Owner

hey @codeandcats - theres two alternatives if you're interested

Option 1

replace https://github.com/codeandcats/fast-clone/blob/master/src/index.ts#L38 with rfdc(value), you could also remove https://github.com/codeandcats/fast-clone/blob/master/src/index.ts#L28-L32. The only difference is it would reference any functions from the original object, so that might take some documenting

Option 2

deprecate as planned, but would you consider passing on the namespace? - it's a crowded area hence rfdc

@codeandcats
Copy link

Hi David,

Yeah it's pretty hard to find a decent name for packages on npm these days (hence why I recently created this little site to help find/suggest a name 😉).

Option 2: If you want to rename rfdc to fast-clone then I'm happy to add you as a collaborator on npm so you can deploy your repo there. Though, what would you do with the rfdc name on npm? Leave it as is and stop publishing new versions to it? Deprecate it and point to fast-clone? Push new versions to both?

@niftylettuce
Copy link
Author

I left a few comments over on codeandcats/fast-clone#27 a bit ago.

Also I wanted to share this blog post https://medium.com/@roman.zenka/the-twin-volcanoes-of-javascript-533fc7a9c3e6 which discusses the extensive amount of packages that do cloning. It's a good read.

@davidmarkclements
Copy link
Owner

@niftylettuce very cool!

@codeandcats While rfdc has 20k shy of 1m dl's p/w it only has 13 dependents, so I'd deploy fast-clone v2.0.0 (which would be rfdc) and then PR the 13 dependents letting them know. I wouldn't deprecate until log4js has accepted the PR, because log4js is responsible for the majority of downloads and I'd rather not freak out a fraction of their millions of users, which then may cause unnecessary overhead for the log4js authors as they interact with users opening issues etc. But yeah if this works for you, it works for me

@codeandcats
Copy link

@davidmarkclements cool, sounds like a responsible plan of action. 👌

I have added you as a maintainer for fast-clone on npm. Go for it. 😃

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

No branches or pull requests

3 participants