Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/operation-graph > Operation > weight

Operation.weight property

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The weight for this operation. This scalar is the contribution of this operation to the criticalPathLength calculation above. Modify to indicate the following: - weight === 1: indicates that this operation has an average duration - weight > 1: indicates that this operation takes longer than average and so the scheduler should try to favor starting it over other, shorter operations. An example might be an operation that bundles an entire application and runs whole-program optimization. - weight < 1: indicates that this operation takes less time than average and so the scheduler should favor other, longer operations over it. An example might be an operation to unpack a cached output, or an operation using NullOperationRunner, which might use a value of 0.

Signature:

weight: number;