# \[Solved\] Is it to be expected for a ci::geom::SourceMods to render much slower than a ci::gl::BatchRef?

**URL:** <https://discourse.libcinder.org/t/solved-is-it-to-be-expected-for-a-ci-sourcemods-to-render-much-slower-than-a-ci-batchref/1441>\
**Category:** Uncategorized\
**Created:** [February 25, 2019, 6:44am UTC](https://discourse.libcinder.org/t/solved-is-it-to-be-expected-for-a-ci-sourcemods-to-render-much-slower-than-a-ci-batchref/1441 "2019-02-25T06:44:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gazoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gazoo/32/61_2.png) [@Gazoo](https://discourse.libcinder.org/u/Gazoo)\
**Post date:** [February 25, 2019, 6:44am UTC](https://discourse.libcinder.org/t/solved-is-it-to-be-expected-for-a-ci-sourcemods-to-render-much-slower-than-a-ci-batchref/1441/1 "2019-02-25T06:44:00Z")

</div>

Hey Embers,

I’m working with some code which generates some 3D text geometry. It basically renders out some text via Cinder’s awesome text code, grabs some contours, applied the `ci::geom::Extrude` function and voila - 3D text geometry.

I allow for both a `ci::geom::SourceMods` object to be created, as well as a `ci::gl::BatchRef`. The `ci::gl::BatchRef` is created simply as a function of the other, thusly:

```
ci::gl::BatchRef FactoryText3D::Create3DTextBatch( std::string const& text, Alignment alignment, int wrapWidth )
{
	auto batch = ci::gl::Batch::create( Create3DTextGeometry(text, alignment, wrapWidth), mGlsl );
	return batch;
}

```

where `mGlsl` is just the default Lambert shader.

As the topic title implies, the `ci::geom::SourceMods` renders far slower than the batch, and I don’t really get why. Like a factor of 3x slower or more. I’ve looked a bit at the different code which handles rendering for the `SourceMods` or `BatchRef` but I’m not wise enough to get the crucial difference.

I’m mostly asking out of curiosity, but wouldn’t also mind knowing what the preferred approach is. My current understanding is that Batches are generally where it’s at.

Thanks in advance,

Gazoo

---

<div class="post-metadata">

**Author:** ![paul.houx](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/paul.houx/32/31_2.png) [@paul.houx](https://discourse.libcinder.org/u/paul.houx)\
**Post date:** [February 25, 2019, 8:48am UTC](https://discourse.libcinder.org/t/solved-is-it-to-be-expected-for-a-ci-sourcemods-to-render-much-slower-than-a-ci-batchref/1441/2 "2019-02-25T08:48:54Z")

</div>

A `Batch` creates the required `Vao` and `Vbo` and caches the attribute locations in the shader. This means that all that information is already available when it’s time to draw. The `geom` classes only store information in CPU memory and don’t know anything about the shader (and its attributes) used for rendering. So it needs to create all that information each time you draw it.
