Skip to content

Add gradients to benchmark suite#667

Merged
aaronayres35 merged 4 commits into
masterfrom
add-gradients-to-benchmark-suite
Mar 3, 2021
Merged

Add gradients to benchmark suite#667
aaronayres35 merged 4 commits into
masterfrom
add-gradients-to-benchmark-suite

Conversation

@aaronayres35
Copy link
Copy Markdown
Contributor

@aaronayres35 aaronayres35 commented Mar 2, 2021

closes #664

This PR adds 2 new benchmarks to the benchmark suite. One draws a path and fills it using linear_gradient. The other draws some text and fills it using radial_gradient after setting the text drawing mode to TEXT_FILL_STROKE. I went with TEXT_FILL_STROKE instead of FILL_STROKE as the results seemed more sensible.

Here are the results I currently see:

Details Screen Shot 2021-03-02 at 2 18 56 PM

Sorry for the very small screenshot. The backends are in the order kiva.agg, celiagg, opengl, qpainter, quartz
Screen Shot 2021-03-02 at 2 19 54 PM
The discrepancy in the qpainter fill I suspect is related to #660 ?

Screen Shot 2021-03-02 at 2 20 13 PM

Copy link
Copy Markdown
Member

@jwiggins jwiggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor comments. These are good tests for the various backends.

I think I'm going to remove the deferred imports though... They make the code kinda ugly for no benefit. We just have to be careful to only import modules and nothing else.

Comment thread enable/gcbench/suite.py Outdated
Comment thread enable/gcbench/suite.py
Comment on lines +159 to +162
import numpy as np
# colors are 5 doubles: offset, red, green, blue, alpha
starting_color = np.array([0.0, 1.0, 1.0, 1.0, 1.0])
ending_color = np.array([1.0, 0.0, 0.0, 0.0, 1.0])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this setup of the gradient array out of __call__ and into __init__.

Comment thread enable/gcbench/suite.py
y = 256 - self.font.size * 1.4
for line in self.text:
self.gc.set_text_position(4, y)
self.gc.show_text(line)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL. Nothing renders this how I would expect.

Copy link
Copy Markdown
Member

@jwiggins jwiggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes

@aaronayres35 aaronayres35 merged commit fb2c6a1 into master Mar 3, 2021
@jwiggins jwiggins deleted the add-gradients-to-benchmark-suite branch March 3, 2021 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gradients to the benchmark suite

2 participants