Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!