# Submit bigger primitive batches when rendering \(\#4087\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/79679cb6160a28cd5053f26bc80fe98937355d21)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 79679cb6160a28cd5053f26bc80fe98937355d21

Requested commit: 79679cb6160a28cd5053f26bc80fe98937355d21

Commit: 79679cb6160a28cd5053f26bc80fe98937355d21

Tree: 4e2ff1e5ecf021bec51e71a3810bb4916ff31ff6

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Submit bigger primitive batches when rendering (#4087)

Before this change we wouldn't submit all possible primitives of the
same kind that are less-than the max order.

Result was that we would submit, say, 10 paths each in a separate batch
instead of actually batching them.

This was overly strict because even if the order of two different
primitives was the same, we could have still batched the 1st primitive
kind, if its implicit ordering was less than 2nd kind.

Example: say we have the following primitives and these orders

  5x paths, order 3
  2x sprites, order 3

Previously, we would submit 1 path, 1 path, 1 path, 1 path, 1 path, then
the sprites.

With this changes, we batch the 5 paths into one batch.

Release Notes:

- Improved performance when rendering lots of selection.
```

## Parents

- [f6b7a06199605591888cc34dfdc8058674e03e41](https://git.cafe/gitcafe/zed/commit/f6b7a06199605591888cc34dfdc8058674e03e41?format=markdown)

- [5b0b9ff5828251e8e85b698bfb0a4437d64e2df6](https://git.cafe/gitcafe/zed/commit/5b0b9ff5828251e8e85b698bfb0a4437d64e2df6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/79679cb6160a28cd5053f26bc80fe98937355d21?format=markdown)
