-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prototype For Fast Bulk Sampling Of Pixels #5102
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
9474986
RankFilter : Add perf tests
danieldresser 1bc8ae3
Resample : Test perf
danieldresser-ie 7778e74
Resize : Add perf tests
danieldresser-ie 6bf9ac4
DilateTest : Add test that should make certain errors obvious
danieldresser-ie b63523a
ResampleTest : Add perf tests for inseparable filters
danieldresser-ie 3eb61f7
Warp : Add support for "bilinear" filter
danieldresser-ie b660cec
VectorWarp : Add perf tests
danieldresser-ie 378da65
ImageTransformTest : Pre-cache input for performance tests
danieldresser-ie 74c0192
ImagePlug : Make fundamental constants public constexpr
danieldresser-ie 564c9fb
Sampler : Internal optimizations
danieldresser-ie 57cc622
GafferImage::Sampler : Add visitPixels()
danieldresser-ie 22e069f
GafferImageTest : Add validateVisitPixels
danieldresser-ie e0c223a
Sampler : Test visitPixels
danieldresser-ie c53eed3
GafferImage::Resample : Optimize using visitPixels
danieldresser-ie d4bbbaa
SConstruct : Hack around compiler perfomance bug
danieldresser-ie 81b06b2
GafferImage::Resample : Optimize inseparable filters
danieldresser-ie 52d68f9
RankFilter : Optimize using visitPixels
danieldresser-ie 885c075
Sampler : Optimize common case where we are within data tile
danieldresser-ie 44f314c
FilterAlgo::sampleBox : Optimize using visitPixels
danieldresser-ie 8eec8bd
Prototype some scripts for graphing performance results in contrib
danieldresser-ie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#! /usr/bin/env python | ||
|
||
import argparse | ||
import inspect | ||
import subprocess | ||
import os | ||
import json | ||
import matplotlib.pyplot as plt | ||
import matplotlib.ticker | ||
|
||
parser = argparse.ArgumentParser( | ||
description = inspect.cleandoc( | ||
""" | ||
Graph the performance results for a folder of json files. | ||
""" ) | ||
) | ||
|
||
parser.add_argument( | ||
'jsonFolder', | ||
help='Folder containing json files' | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
jsonFolder = vars( args )["jsonFolder"] | ||
|
||
jsonFileNames = [ i for i in os.listdir( jsonFolder ) if i.endswith( ".json" ) ] | ||
|
||
results = [] | ||
for n in jsonFileNames: | ||
f = open( "%s/%s" % ( jsonFolder, n ) ) | ||
d = json.load( f ) | ||
f.close() | ||
|
||
r = {} | ||
for key, value in d.items(): | ||
if "timings" in value: | ||
r[ key.split()[1].split('.')[-1][:-1] + "." + key.split()[0]] = ( min( value["timings"] ), max( value["timings"] ) ) | ||
|
||
resultName = n[:-5] | ||
resultOrder = resultName | ||
|
||
try: | ||
resultOrder = int( subprocess.check_output( [ "git", "rev-list", "--count", resultName ] ) ) | ||
resultName = subprocess.check_output( [ "git", "log", "--format=%B", "-n 1", resultName ] ).splitlines()[0].decode( "UTF-8" ) | ||
except: | ||
pass | ||
|
||
results.append( [resultOrder, resultName, r] ) | ||
|
||
results.sort() | ||
results = [r[1:] for r in results ] | ||
|
||
ax = plt.subplot(111) | ||
|
||
curveNames = results[0][1].keys() | ||
curveNames = sorted( curveNames, key = lambda k : -results[-1][1][k][0] ) | ||
for k in curveNames: | ||
ax.plot( [ j[1][k][0] for j in results ], label = k ) | ||
# Use this line instead if you want to see variability | ||
#ax.fill_between( range( len( results ) ), [ j[1][k][0] for j in results ], [ j[1][k][1] for j in results ], label = k ) | ||
|
||
plt.yscale( "log", base = 2 ) | ||
|
||
# Force labelling of every power of two | ||
plt.yticks( [2**i for i in range( -4, 4 )] ) | ||
|
||
ax.xaxis.set_major_formatter( matplotlib.ticker.FuncFormatter( lambda i, pos : results[int(i)][0] ) ) | ||
plt.xticks( rotation = 45, ha = "right" ) | ||
|
||
box = ax.get_position() | ||
|
||
# Create margin | ||
ax.set_position([box.x0, box.y0 + box.height * 0.2, box.width * 0.8, box.height * 0.8]) | ||
|
||
# Put a legend to the right of the current axis | ||
ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) | ||
|
||
# Currently hacking things up to work with very old matplotlib | ||
#plt.show_all() | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#! /usr/bin/env python | ||
|
||
import argparse | ||
import inspect | ||
import subprocess | ||
import os | ||
|
||
parser = argparse.ArgumentParser( | ||
description = inspect.cleandoc( | ||
""" | ||
Run a selection of Gaffer tests for a specified set of commits, | ||
outputting a separate json file for the tests for each commit. | ||
""" ) | ||
) | ||
|
||
parser.add_argument( | ||
'--commits', action='store', nargs='+', | ||
help='Hashes of commits to build' | ||
) | ||
|
||
parser.add_argument( | ||
'--tests', action='store', nargs='+', | ||
help='Names of tests to run' | ||
) | ||
|
||
parser.add_argument( | ||
'--outputFolder', action='store', required = True, | ||
help='Folder to put output json files to' | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
outputFolder = vars( args )["outputFolder"] | ||
try: | ||
os.makedirs( outputFolder ) | ||
except: | ||
pass | ||
|
||
currentBranch = subprocess.check_output( [ "git", "stat", "-s", "-b" ] ).splitlines()[0].split()[1] | ||
print( currentBranch ) | ||
for c in vars( args )["commits"]: | ||
subprocess.check_call( [ "git", "checkout", c ] ) | ||
subprocess.check_call( [ "scons", "-j 16", "build" ] ) | ||
subprocess.check_call( [ "gaffer", "test" ] + vars( args )["tests"] + [ "-outputFile", "%s/%s.json" % ( outputFolder, c ) ] ) | ||
|
||
subprocess.check_call( [ "git", "checkout", currentBranch ] ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you have any objection to
F( const V2i &p, float value )
?