Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
_.intersectionBy() vs vanillaJS
(version: 0)
Comparing performance of:
vanillaJS vs lodash
Created:
4 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Script Preparation code:
var categoryPackages = [{ identifier: 'RKPNC3', originalPrices: [{ priceWithTaxes: 485, priceWithoutTaxes: 404.17, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKPNC3', operationDuration: 1.5, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein avant <br />\r\n• Les disques de frein avant <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des disques et plaquettes de frein avant', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_3', label: 'Remplacement Disques et Plaquettes avant', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 485, priceWithoutTaxes: 404.17, discountedPriceWithTaxes: 485, discountedPriceWithoutTaxes: 404.17, priceId: 'OQ_FR_RENAULT_RKPNC3', currency: 'EUR', discounts: [], }, ], relations: [], errorAgainstProductIds: ['OQ_FR_RENAULT_RKMNC3'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces d'origine constructeur <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKMNC3', originalPrices: [{ priceWithTaxes: 413, priceWithoutTaxes: 344.17, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKMNC3', operationDuration: 1.5, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein avant <br />\r\n• Les disques de frein avant <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des disques et plaquettes de frein avant', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_3', label: 'Remplacement Disques et Plaquettes avant', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 413, priceWithoutTaxes: 344.17, discountedPriceWithTaxes: 413, discountedPriceWithoutTaxes: 344.17, priceId: 'OQ_FR_RENAULT_RKMNC3', currency: 'EUR', discounts: [], }, ], relations: [{ type: 'ALTERNATIVE', targetObjectId: 'OQ_FR_RENAULT_RKPNC3', targetObjectType: 'PRODUCT', }, ], errorAgainstProductIds: ['OQ_FR_RENAULT_RKPNC3'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces Motrio <br />\r\n• La garantie 1 an pièces et main d'œuvre<br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKMND8', originalPrices: [{ priceWithTaxes: 433, priceWithoutTaxes: 360.83, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKMND8', operationDuration: 1.4, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein arrière <br />\r\n• Les disques de frein arrière <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des disques et plaquettes de frein arrière', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_4', label: 'Remplacement Disques et Plaquettes arrière', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 433, priceWithoutTaxes: 360.83, discountedPriceWithTaxes: 433, discountedPriceWithoutTaxes: 360.83, priceId: 'OQ_FR_RENAULT_RKMND8', currency: 'EUR', discounts: [], }, ], relations: [{ type: 'ALTERNATIVE', targetObjectId: 'OQ_FR_RENAULT_RKPND8', targetObjectType: 'PRODUCT', }, ], errorAgainstProductIds: ['OQ_FR_RENAULT_RKPND8'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces Motrio <br />\r\n• La garantie 1 an pièces et main d'œuvre<br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKPND8', originalPrices: [{ priceWithTaxes: 509, priceWithoutTaxes: 424.17, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKPND8', operationDuration: 1.4, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein arrière <br />\r\n• Les disques de frein arrière <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des disques et plaquettes de frein arrière', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_4', label: 'Remplacement Disques et Plaquettes arrière', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 509, priceWithoutTaxes: 424.17, discountedPriceWithTaxes: 509, discountedPriceWithoutTaxes: 424.17, priceId: 'OQ_FR_RENAULT_RKPND8', currency: 'EUR', discounts: [], }, ], relations: [], errorAgainstProductIds: ['OQ_FR_RENAULT_RKMND8'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces d'origine constructeur <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKPNB3', originalPrices: [{ priceWithTaxes: 199, priceWithoutTaxes: 165.83, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKPNB3', operationDuration: 1.1, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein arrière <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des plaquettes de frein arrière', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_2', label: 'Remplacement plaquettes arrière', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 199, priceWithoutTaxes: 165.83, discountedPriceWithTaxes: 199, discountedPriceWithoutTaxes: 165.83, priceId: 'OQ_FR_RENAULT_RKPNB3', currency: 'EUR', discounts: [], }, ], relations: [], errorAgainstProductIds: ['OQ_FR_RENAULT_RKMNB3'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces d'origine constructeur <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKMNB3', originalPrices: [{ priceWithTaxes: 170, priceWithoutTaxes: 141.67, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKMNB3', operationDuration: 1.1, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein arrière <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des plaquettes de frein arrière', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_2', label: 'Remplacement plaquettes arrière', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 170, priceWithoutTaxes: 141.67, discountedPriceWithTaxes: 170, discountedPriceWithoutTaxes: 141.67, priceId: 'OQ_FR_RENAULT_RKMNB3', currency: 'EUR', discounts: [], }, ], relations: [{ type: 'ALTERNATIVE', targetObjectId: 'OQ_FR_RENAULT_RKPNB3', targetObjectType: 'PRODUCT', }, ], errorAgainstProductIds: ['OQ_FR_RENAULT_RKPNB3'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces Motrio <br />\r\n• La garantie 1 an pièces et main d'œuvre<br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKPNA2', originalPrices: [{ priceWithTaxes: 199, priceWithoutTaxes: 165.83, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKPNA2', operationDuration: 1, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein avant <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des plaquettes de frein avant', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_1', label: 'Remplacement plaquettes avant', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 199, priceWithoutTaxes: 165.83, discountedPriceWithTaxes: 199, discountedPriceWithoutTaxes: 165.83, priceId: 'OQ_FR_RENAULT_RKPNA2', currency: 'EUR', discounts: [], }, ], relations: [], errorAgainstProductIds: ['OQ_FR_RENAULT_RKMNA2'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces d'origine constructeur <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKMNA2', originalPrices: [{ priceWithTaxes: 170, priceWithoutTaxes: 141.67, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKMNA2', operationDuration: 1, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein avant <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des plaquettes de frein avant', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_1', label: 'Remplacement plaquettes avant', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 170, priceWithoutTaxes: 141.67, discountedPriceWithTaxes: 170, discountedPriceWithoutTaxes: 141.67, priceId: 'OQ_FR_RENAULT_RKMNA2', currency: 'EUR', discounts: [], }, ], relations: [{ type: 'ALTERNATIVE', targetObjectId: 'OQ_FR_RENAULT_RKPNA2', targetObjectType: 'PRODUCT', }, ], errorAgainstProductIds: ['OQ_FR_RENAULT_RKPNA2'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces Motrio <br />\r\n• La garantie 1 an pièces et main d'œuvre<br />", type: 'SHORT', }, ], productType: 'online_quote', }, ]; var selectedPackages = [{ identifier: 'RKPNC3', originalPrices: [{ priceWithTaxes: 485, priceWithoutTaxes: 404.17, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKPNC3', operationDuration: 1.5, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein avant <br />\r\n• Les disques de frein avant <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des disques et plaquettes de frein avant', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_3', label: 'Remplacement Disques et Plaquettes avant', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 485, priceWithoutTaxes: 404.17, discountedPriceWithTaxes: 485, discountedPriceWithoutTaxes: 404.17, priceId: 'OQ_FR_RENAULT_RKPNC3', currency: 'EUR', discounts: [], }, ], relations: [], errorAgainstProductIds: ['OQ_FR_RENAULT_RKMNC3'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces d'origine constructeur <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKMND8', originalPrices: [{ priceWithTaxes: 433, priceWithoutTaxes: 360.83, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKMND8', operationDuration: 1.4, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein arrière <br />\r\n• Les disques de frein arrière <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des disques et plaquettes de frein arrière', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_4', label: 'Remplacement Disques et Plaquettes arrière', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 433, priceWithoutTaxes: 360.83, discountedPriceWithTaxes: 433, discountedPriceWithoutTaxes: 360.83, priceId: 'OQ_FR_RENAULT_RKMND8', currency: 'EUR', discounts: [], }, ], relations: [{ type: 'ALTERNATIVE', targetObjectId: 'OQ_FR_RENAULT_RKPND8', targetObjectType: 'PRODUCT', }, ], errorAgainstProductIds: ['OQ_FR_RENAULT_RKPND8'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces Motrio <br />\r\n• La garantie 1 an pièces et main d'œuvre<br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKPNB3', originalPrices: [{ priceWithTaxes: 199, priceWithoutTaxes: 165.83, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKPNB3', operationDuration: 1.1, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein arrière <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des plaquettes de frein arrière', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_2', label: 'Remplacement plaquettes arrière', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 199, priceWithoutTaxes: 165.83, discountedPriceWithTaxes: 199, discountedPriceWithoutTaxes: 165.83, priceId: 'OQ_FR_RENAULT_RKPNB3', currency: 'EUR', discounts: [], }, ], relations: [], errorAgainstProductIds: ['OQ_FR_RENAULT_RKMNB3'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces d'origine constructeur <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", type: 'SHORT', }, ], productType: 'online_quote', }, { identifier: 'RKPNA2', originalPrices: [{ priceWithTaxes: 199, priceWithoutTaxes: 165.83, currency: 'EUR', }, ], productId: 'OQ_FR_RENAULT_RKPNA2', operationDuration: 1, description: "<b> Ce forfait comprend : </b> <br /><br />\r\n• Les plaquettes de frein avant <br />\r\n• La main d'œuvre associée à l'opération <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", taxes: [{ taxCode: 'VAT', taxValue: 20, }, ], tyreQuantity: 0, packageType: 'MAINTENANCE', recommended: false, provider: 'RENAULT', localeEnabled: '1', localePublished: '2020-11-29', name: 'Remplacement des plaquettes de frein avant', categories: [{ parent: 'main_oq_fr_renault_cat_c', code: 'main_oq_fr_renault_subcat_c_1', label: 'Remplacement plaquettes avant', }, { parent: 'main_oq_fr_brand_renault', code: 'main_oq_fr_renault_cat_c', label: 'Freinage', }, { parent: 'main_oq_country_fr', code: 'main_oq_fr_brand_renault', label: 'Renault', }, { parent: 'main_oq', code: 'main_oq_country_fr', label: 'FR', }, { parent: 'main', code: 'main_oq', label: 'Devis en ligne', }, { parent: '', code: 'main', label: 'SI Renault', }, ], prices: [{ priceWithTaxes: 199, priceWithoutTaxes: 165.83, discountedPriceWithTaxes: 199, discountedPriceWithoutTaxes: 165.83, priceId: 'OQ_FR_RENAULT_RKPNA2', currency: 'EUR', discounts: [], }, ], relations: [], errorAgainstProductIds: ['OQ_FR_RENAULT_RKMNA2'], technicalTeam: '', extendedDescriptions: [{ description: "• Les pièces d'origine constructeur <br />\r\n• La garantie 1 an pièces et main d'œuvre <br />", type: 'SHORT', }, ], productType: 'online_quote', }, ];
Tests:
vanillaJS
function intersectionVanilla(categoryPackages, selectedPackages) { return ( ( categoryPackages.reduce( (acc, categoryPackage) => selectedPackages.some( selectedPackage => _.get(categoryPackage, 'categories[0].parent') === _.get(selectedPackage, 'categories[0].parent') ) ? [...acc, categoryPackage] : acc, [] ) || [] ).length > 0 ); } intersectionVanilla(categoryPackages, selectedPackages);
lodash
function intersectionLodash(categoryPackages, selectedPackages) { return ( _.intersectionBy(categoryPackages, selectedPackages, 'categories[0].parent') .length > 0 ); } intersectionLodash(categoryPackages, selectedPackages);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
vanillaJS
lodash
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):
I'll provide the answer. Based on the provided benchmark results, it appears that the Lodash version of the `intersectionVanilla` function is performing significantly better than its vanilla JavaScript counterpart. The latest benchmark result shows: * For the "vanillaJS" test, with 317005 executions per second. * For the "lodash" test, with 188045 executions per second. This suggests that using Lodash's optimized implementation of `intersectionBy` is providing a substantial speedup compared to writing the same logic from scratch in vanilla JavaScript.
Related benchmarks:
Vanilla vs Lodash
Map, filter, reduce, intersection comparison
Map, filter, concat, intersection comparison
Javascript destructuring vs assign
Comments
Confirm delete:
Do you really want to delete benchmark?