# Opportunities for Jobs with High Duration

**URL:** <https://discuss.circleci.com/t/opportunities-for-jobs-with-high-duration/48614>\
**Category:** Self Service Configuration Review\
**Tags:** self-serve, config-review, manual\
**Created:** [July 11, 2023, 6:17pm UTC](https://discuss.circleci.com/t/opportunities-for-jobs-with-high-duration/48614 "2023-07-11T18:17:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![felixshiftellecon](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felixshiftellecon/32/33360_2.png) [@felixshiftellecon](https://discuss.circleci.com/u/felixshiftellecon)\
**Post date:** [July 11, 2023, 6:17pm UTC](https://discuss.circleci.com/t/opportunities-for-jobs-with-high-duration/48614/1 "2023-07-11T18:17:43Z")

</div>

# Review Each Job for Improvement Opportunities

## Opportunities for Jobs with High Duration

### 1) Resource Allocation

Optimizing the [resource classes](https://circleci.com/docs/glossary/#resource-class) of your [jobs](https://circleci.com/docs/glossary/#job) is an easy way to attempt to reduce the duration of a job. Each job has a resource tab in the UI showing the resource usage throughout the job, which is useful while reviewing jobs individually. [CircleCI’s Insights UI](https://circleci.com/docs/resource-class-overview/#resource-class-insights) offers a view of historical usage for every job in a workflow which is more helpful when doing a config review.

A good rule of thumb is a job should be using 50% - 75% of its resources. If a job is outside of that band try out one of the other resource classes for the [execution environment being used](https://circleci.com/product/features/resource-classes/).

**NOTE:** Increasing resource class size does not guarantee a job’s duration will be reduced.

### 2) Caching

Jobs that install dependencies should [cache those dependencies](https://circleci.com/docs/caching) to speed up install time for future jobs. Caches are [project](https://circleci.com/docs/glossary/#project) wide so multiple jobs and multiple workflows can share them.

Most dependencies support using a [fallback cache key](https://circleci.com/docs/caching-strategy/#partial-dependency-caching-strategies) to allow for a partial cache match. Implementing a fallback cache key can help reduce duration when making changes on a new branch.

Review how [specific any current cache keys are](https://circleci.com/docs/caching-strategy/#avoid-strict-cache-keys) and if they need to be more or less specific.

### 3) Test splitting

Jobs that run tests can most likely be split. [Test splitting](https://circleci.com/docs/parallelism-faster-jobs/) runs multiple instances of the job in parallel and splits the tests among them, with [splitting by timing](https://circleci.com/docs/parallelism-faster-jobs/#how-test-splitting-works) being the more optimized approach. The [parallelism of the job](https://circleci.com/docs/parallelism-faster-jobs/#specify-a-jobs-parallelism-level) should be set to balance dependency setup time versus test suite duration. [The Timing tab](https://circleci.com/docs/test-splitting-tutorial/#step-three-view-results) in each job’s UI is helpful when reviewing that balance.

### 4) Docker Layer Caching

Jobs that build docker images can typically benefit from enabling [Docker Layer Caching](https://circleci.com/docs/docker-layer-caching/). DLC caches individual docker image layers so they can be used in future jobs.

* * *

> **▶ Next Step: [Review Each Workflow for Improvement Opportunities](https://discuss.circleci.com/t/review-each-workflow-for-improvement-opportunities/48615)**
> 
> **◀ Previous Step: [Execution Environment Opportunities](https://discuss.circleci.com/t/execution-environment-opportunities/48613)**

> **📑 Table of Contents**
>
> [Self Service Configuration Review Overview](https://discuss.circleci.com/t/overview-self-service-configuration-review/48598)
> 
> 1. [Configuration Review Preparation](https://discuss.circleci.com/t/configuration-review-preparation/48607)
> - [Document the Config Review](https://discuss.circleci.com/t/document-the-config-review/48608)
> - [Review CircleCI Features](https://discuss.circleci.com/t/review-circleci-features/48609)
> - [Snapshot Project Metrics](https://discuss.circleci.com/t/snapshot-project-metrics/48610)
> 
> 2. [Review Each Job for Improvement Opportunities](https://discuss.circleci.com/t/review-each-job-for-improvement-opportunities/48611)
> - [General Job Opportunities](https://discuss.circleci.com/t/general-job-opportunities/48612)
> - [Execution Environment Opportunities](https://discuss.circleci.com/t/execution-environment-opportunities/48613)
> - **[Opportunities for Jobs with High Duration](https://discuss.circleci.com/t/opportunities-for-jobs-with-high-duration/48614)**
> 
> 3. [Review Each Workflow for Improvement Opportunities](https://discuss.circleci.com/t/review-each-workflow-for-improvement-opportunities/48615)
> 4. [High Level Improvement Opportunities](https://discuss.circleci.com/t/high-level-improvement-opportunities/48616)
> - [Inside the Config](https://discuss.circleci.com/t/high-level-improvement-opportunities/48616#inside-the-config-3)
> - [Config Security](https://discuss.circleci.com/t/config-security-opportunities/48618)
> - [Reusable Config](https://discuss.circleci.com/t/reusable-config-opportunities/48619)
> - [Dynamic Configuration](https://discuss.circleci.com/t/dynamic-configuration/48620)
> 
> - [Outside the Config](https://discuss.circleci.com/t/high-level-improvement-opportunities/48616#outside-the-config-4)
> - [Security Settings](https://discuss.circleci.com/t/outside-a-config-file-security-settings/48622)
> - [Secret Management](https://discuss.circleci.com/t/outside-a-config-file-secrets-management/48623)
> - [Storage Usage](https://discuss.circleci.com/t/outside-a-config-file-storage-usage/48624)
> - [Project Settings](https://discuss.circleci.com/t/outside-a-config-file-project-settings/48625)
> 
> 5. [Finalize Review](https://discuss.circleci.com/t/finalize-the-config-review/48626)
