> ## Documentation Index
> Fetch the complete documentation index at: https://help.draftable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Comparison speeds and batch processing

> How long Draftable API comparisons typically take, why PDFs are faster than Word documents, and how batch jobs are prioritised and processed in parallel.

This article covers how long comparisons take and what happens when you submit a lot of them at once. It is the reference for questions like "how long should I let this run before timing out?" and "do I need to throttle my requests?".

## Expected time to compare

Most of the time in a comparison is spent on **data transfer and file conversion**, not the comparison itself. That has one consequence worth designing around: **comparing PDFs is several times faster than comparing Word documents**, because PDFs need less conversion work.

Speeds vary with document content and server load, but these ranges are a reasonable guideline for how long a comparison takes to become ready after submission.

| Comparison   | Approximate pages | Typical time     |
| :----------- | :---------------: | :--------------- |
| PDF to PDF   |         20        | 1 to 3 seconds   |
| PDF to PDF   |        100        | 3 to 7 seconds   |
| PDF to PDF   |        400        | 10 to 20 seconds |
| DOCX to DOCX |         20        | 4 to 10 seconds  |
| DOCX to DOCX |        100        | 15 to 45 seconds |
| DOCX to DOCX |        400        | 30 to 60 seconds |

<Note>
  These are guidelines, not guarantees. Treat them as a basis for setting sensible timeouts and user expectations rather than as a service level commitment.
</Note>

<Tip>
  If comparison speed matters to your integration and you control the documents, converting to PDF before submission is the single most effective change you can make. A 100-page DOCX-to-DOCX comparison can take several times longer than the equivalent PDF-to-PDF comparison.
</Tip>

## Setting timeouts

Use the table above to choose a timeout that suits the documents you actually handle, then add generous headroom for server load.

A practical approach is to poll with a backoff and give up well past the expected time, surfacing a clear message to the user rather than hanging. See [Viewing and sharing comparison results](/hc/en-us/articles/Draftable-API-viewing-and-sharing-results) for the polling pattern, and the `wait` parameter that lets you skip polling entirely.

## Batch jobs

**You do not need to rate limit, throttle, or spread out your comparisons.** If you submit a large number at once, Draftable works through them in sequence and in parallel.

<Note>
  Submitting a batch all at once gets it processed **fastest**. Deliberately spacing out submissions does not help and will usually make the whole job take longer.
</Note>

### How prioritisation works

Draftable recognises two usage patterns and prioritises them differently, automatically.

| Pattern         | Example                                                           | Priority | Why                                                                        |
| :-------------- | :---------------------------------------------------------------- | :------- | :------------------------------------------------------------------------- |
| **Single task** | One of your end users requests a comparison and is waiting for it | High     | Someone is watching a loading spinner                                      |
| **Batch job**   | You submit a very large number of comparisons at once             | Normal   | What matters is when the *whole batch* finishes, not any single comparison |

Your usage pattern is **detected automatically**. There is no parameter to set and nothing to configure. Interactive comparisons stay responsive even while a large batch is running, and batches are worked through at a steady rate so they do not block the service for other users.

### Batch throughput

Batch comparisons are processed in parallel, so a batch finishes far faster than the sum of its parts.

At least **10 comparisons are processed in parallel** in a batch job. So a batch of 100 comparisons that each take 10 seconds does not take 1,000 seconds; it should complete in under 100 seconds.

<Tip>
  When estimating how long a bulk job will take, divide the total sequential time by at least 10. Build your progress reporting around the batch completing, not around individual comparisons finishing in a predictable order.
</Tip>

## If comparisons are slower than expected

<Steps>
  <Step title="Check the file types">
    Word to Word comparisons are legitimately several times slower than PDF to PDF. Confirm you are comparing what you think you are.
  </Step>

  <Step title="Check the document size and page count">
    The times above scale with length. A document far larger than 400 pages will take proportionally longer, and may exceed your account's page limit entirely.
  </Step>

  <Step title="Check how the files are supplied">
    If you supply a `source_url`, Draftable has to fetch the file first. A slow or distant host adds that fetch time to every comparison.
  </Step>

  <Step title="Confirm it is not actually failing">
    A comparison that has finished unsuccessfully is `ready` but `failed`. If your code only checks `ready`, a failure can look like a hang. See [Handling errors and comparison failures](/hc/en-us/articles/Draftable-API-handling-errors).
  </Step>

  <Step title="Check the service status">
    If comparisons are broadly slow rather than slow for specific documents, check [Draftable API status](/hc/en-us/articles/43677873463705-Checking-Draftable-API-Status).
  </Step>
</Steps>

## Related articles

<CardGroup>
  <Card title="Creating a comparison" icon="file-import" href="/hc/en-us/articles/Draftable-API-creating-a-comparison" iconType="solid" horizontal />

  <Card title="Viewing and sharing results" icon="eye" href="/hc/en-us/articles/Draftable-API-viewing-and-sharing-results" iconType="solid" horizontal />

  <Card title="Handling errors and failures" icon="triangle-exclamation" href="/hc/en-us/articles/Draftable-API-handling-errors" iconType="solid" horizontal />

  <Card title="Checking Draftable API status" icon="signal" href="/hc/en-us/articles/43677873463705-Checking-Draftable-API-Status" iconType="solid" horizontal />
</CardGroup>
