Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Native deepclone vs JS
(version: 0)
Comparing performance of:
clone using lodash vs clone using JS
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var objects = { isCoachmark: false, coachmarkReady: false, routes: { Premium: { dashboard: { disableCoachmark: false, components: { honors: { key: 'routes.Premium.dashboard.components.honors', text: 'Earn Honours for reaching new milestones! Check here to see all the Lido Honours you can earn 🏅', position: 'bottom', order: 7, isShown: false }, greetingHeader: { key: 'routes.Premium.dashboard.components.greetingHeader', text: 'The more you learn, the more you earn! Click here to know all about Gems on Lido. Learn how you can earn gems and what rewards you can redeem with gems! 🎁', position: 'bottom', order: 8, isShown: false }, upcomingClass: { key: 'routes.Premium.dashboard.components.upcomingClass', text: 'You can see and join all your upcoming classes from here 🗓', position: 'top', order: 2, isShown: false } }, }, 'my-library': { disableCoachmark: false, components: { libraryHeader: { key: 'routes.Premium["my-library"].components.libraryHeader', text: 'These are the courses you’re enrolled in!', position: 'bottom', order: 8, isShown: false }, MPIntroCard: { key: 'routes.Premium["my-library"].components.MPIntroCard', text: 'Your goal is to master all chapters!', position: 'bottom', order: 9, isShown: false }, courseOverviewCard: { key: 'routes.Premium["my-library"].components.courseOverviewCard', text: 'This is where you get an overview for your mastery points for the selected subject.', position: 'bottom', order: 10, isShown: false }, onGoingChapter: { key: 'routes.Premium["my-library"].components.onGoingChapter', text: 'This highlights the chapter that is ongoing in class for this subject.', position: 'top', order: 11, isShown: false }, allChaptersCard: { key: 'routes.Premium["my-library"].components.allChaptersCard', text: 'Here you can see all the chapters of this subject for your grade.', position: 'top', order: 12, isShown: false }, otherContentLink: { key: 'routes.Premium["my-library"].components.otherContentLink', text: 'Here you can access the learning material for other grades and boards!', position: 'bottom', order: 13, isShown: false } } } }, Freemium: { dashboard: { disableCoachmark: false, components: { upcomingClass: { key: 'routes.Freemium.dashboard.components.upcomingClass', text: 'You can see and join all your upcoming classes from here 🗓', position: 'top', order: 1, isShown: false } } }, } }, global: { Premium: { BottomNavBar: { Home: { key: 'global.Premium.BottomNavBar.Home', text: 'Welcome to your Lido Student Dashboard homepage! Let’s take a look around... 😃', position: 'right', order: 1, isShown: false }, Progress: { key: 'global.Premium.BottomNavBar.Progress', text: 'You can track your performance in detail from here ✅', position: 'right', order: 4, isShown: false }, Courses: { key: 'global.Premium.BottomNavBar.Courses', text: 'Check out the revamp of our Course page! Library, courses and progress all in one!', position: 'right', order: 5, isShown: false }, Portfolio: { key: 'global.Premium.BottomNavBar.Portfolio', text: 'Check out your brand new website and share it with your friends. 🎖', position: 'right', order: 6, isShown: false }, SuperParentApp: { key: 'global.Premium.BottomNavBar.SuperParentApp', text: 'Manage your account, courses and schedule from our Super Parent App ⚙️', position: 'right', order: 7, isShown: false }, moreNavBar: { key: 'global.Premium.BottomNavBar.moreNavBar', text: "Click here to access your 'Dashboard', and 'Helpdesk' options", position: 'right', order: 7, isShown: false } } }, Freemium: { BottomNavBar: { Portfolio: { key: 'global.Freemium.BottomNavBar.Portfolio', text: 'Check out your brand new website and share it with your friends. 🎖', position: 'right', order: 2, isShown: false } }, } } };
Tests:
clone using lodash
var deep = _.cloneDeep(objects); console.log(deep);
clone using JS
function clone(target) { if (typeof target === 'object') { let cloneTarget = {}; for (const key in target) { cloneTarget[key] = clone(target[key]); } return cloneTarget; } else { return target; } }; var deep = clone(objects); console.log(deep);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
clone using lodash
clone using JS
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
It seems like you're trying to analyze some JSON data and benchmarking test cases, but there's no direct question being asked. However, I'll try to provide some insights based on the provided data: 1. **JSON Data Analysis**: The JSON data appears to be a nested object with different levels of complexity. It contains objects representing various navigation bars (Premium and Freemium) with their respective properties (key, text, position, order, and isShown). 2. **Benchmarking Test Cases**: There are two test cases provided: - One using Lodash's `_.cloneDeep` function to clone the JSON object. - The other uses a simple JavaScript function to achieve the same result. 3. **Latest Benchmark Results**: The benchmark results show that the JavaScript implementation (Test Name: "clone using JS") outperforms the Lodash implementation (Test Name: "clone using lodash"). If you could provide more context or clarify what specific aspect of this data you'd like me to help with, I'll do my best to assist!
Related benchmarks:
Memory Usage
=== undefined vs hasOwnProperty
acasoveramente
Spread operator cost
String: Includes vs equality check
Comments
Confirm delete:
Do you really want to delete benchmark?