Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

186
Vistas
Does importing all in JavaScript affect performance

I am working on a testing project with the following structure:

project  
│
└─── jrns
│   │   journeys_1.js
│   │   journeys_2.js
|   |   Journeys.js
│   
└─── Test Suites
    │   suite1.js
    │   suite2.js

Each journeys_x file contains some user journeys written as functions, and the whole purpose of the Journeys file is to act as a hub of all the journeys. Journeys.js looks something like this:

import {journey_1_1,
        journey_1_2} from './journeys_1';
export {journey_1_1,
        journey_1_2};

import {journey_2_1,
        journey_2_2} from './journeys_2';
export {journey_2_1,
        journey_2_2};

The purpose of creating that hub is to make importing easier in the test suites:

import * as jrns from '../jrns/Journeys';

jrns.journey_1_2();

My question is the following, does importing everything this way in the test suites files affect performance since not all journeys are actually utilized within every test suite file? Also, if in journeys_1.js for example I needed to access a journey stored in journey_2 for example, would accessing it through the same importing mechanism

import * as jrns from './Journeys';

jrns.journey_2_2();

affect performance?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Performance can have a number of dimensions, i.e. runtime performance, memory complexity, etc. For this sort of thing you might be able to benchmark it but it might only have meaningful impact at some scale. In this case, without knowing the number of imports, it's likely impossible to say that it will have a meaningful affect. Any additional import does cost some runtime or memory space, sure, but as to whether that matters is another question.

To get you to an answer on whether this matters, you could consider whether the project is at scale (some thousands of tests to be run), how frequently this test suite is run (on commit, on PR, etc), and whether it's run on local machines vs a cloud-based CI system. If your project is not at scale and may not be for a long time, or if it is infrequently run, or if it's run in a CI system, the minor difference in runtime performance probably does not have an observable/meaningful effect.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda