def kivy_benchmark(benchmark, kivy_clock): from kivy.core.window import Window from kivy.cache import Cache from kivy.utils import platform import kivy from kivy.core.gl import glGetString, GL_VENDOR, GL_RENDERER, GL_VERSION for category in list(Cache._objects.keys()): if category not in Cache._categories: continue for key in list(Cache._objects[category].keys()): Cache.remove(category, key) gc.collect() benchmark.extra_info['platform'] = str(sys.platform) benchmark.extra_info['python_version'] = str(sys.version) benchmark.extra_info['python_api'] = str(sys.api_version) benchmark.extra_info['kivy_platform'] = platform benchmark.extra_info['kivy_version'] = kivy.__version__ benchmark.extra_info['gl_vendor'] = str(glGetString(GL_VENDOR)) benchmark.extra_info['gl_renderer'] = str(glGetString(GL_RENDERER)) benchmark.extra_info['gl_version'] = str(glGetString(GL_VERSION)) yield benchmark
def kivy_benchmark(benchmark, kivy_clock): from kivy.core.window import Window from kivy.cache import Cache from kivy.utils import platform import kivy from kivy.core.gl import glGetString, GL_VENDOR, GL_RENDERER, GL_VERSION from kivy.context import Context from kivy.clock import ClockBase from kivy.factory import FactoryBase, Factory from kivy.lang.builder import BuilderBase, Builder context = Context(init=False) context['Clock'] = ClockBase() context['Factory'] = FactoryBase.create_from(Factory) context['Builder'] = BuilderBase.create_from(Builder) for category in list(Cache._objects.keys()): if category not in Cache._categories: continue for key in list(Cache._objects[category].keys()): Cache.remove(category, key) gc.collect() benchmark.extra_info['platform'] = str(sys.platform) benchmark.extra_info['python_version'] = str(sys.version) benchmark.extra_info['python_api'] = str(sys.api_version) benchmark.extra_info['kivy_platform'] = platform benchmark.extra_info['kivy_version'] = kivy.__version__ benchmark.extra_info['gl_vendor'] = str(glGetString(GL_VENDOR)) benchmark.extra_info['gl_renderer'] = str(glGetString(GL_RENDERER)) benchmark.extra_info['gl_version'] = str(glGetString(GL_VERSION)) context.push() try: yield benchmark finally: context.pop()
title('Global') report.append('OS platform : %s' % sys.platform) report.append('Python EXE : %s' % sys.executable) report.append('Python Version : %s' % sys.version) report.append('Python API : %s' % sys.api_version) report.append('Kivy Version : %s' % kivy.__version__) report.append('Install path : %s' % os.path.dirname(kivy.__file__)) report.append('Install date : %s' % ctime(os.path.getctime(kivy.__file__))) report_dict['Global'] = report report = [] title('OpenGL') from kivy.core import gl from kivy.core.window import Window report.append('GL Vendor: %s' % gl.glGetString(gl.GL_VENDOR)) report.append('GL Renderer: %s' % gl.glGetString(gl.GL_RENDERER)) report.append('GL Version: %s' % gl.glGetString(gl.GL_VERSION)) ext = gl.glGetString(gl.GL_EXTENSIONS) if ext is None: report.append('GL Extensions: %s' % ext) else: report.append('GL Extensions:') for x in ext.split(): report.append('\t%s' % x) Window.close() report_dict['OpenGL'] = report report = [] title('Core selection') from kivy.core.audio import SoundLoader
log('-------------------') log('OS platform : %s' % sys.platform) log('Python EXE : %s' % sys.executable) log('Python Version : %s' % sys.version) log('Python API : %s' % sys.api_version) log('Kivy Version : %s' % kivy.__version__) log('Install path : %s' % os.path.dirname(kivy.__file__)) log('Install date : %s' % ctime(os.path.getctime(kivy.__file__))) log('') log('OpenGL informations') log('-------------------') from kivy.core.gl import glGetString, GL_VENDOR, GL_RENDERER, GL_VERSION log('GL Vendor: %s' % glGetString(GL_VENDOR)) log('GL Renderer: %s' % glGetString(GL_RENDERER)) log('GL Version: %s' % glGetString(GL_VERSION)) log('') log('Benchmark') log('---------') for x in benchs: # clean cache to prevent weird case for cat in Cache._categories: Cache.remove(cat) # force gc before next test gc.collect()
title("Global") report.append("OS platform : %s | %s" % (plf.platform(), plf.machine())) report.append("Python EXE : %s" % sys.executable) report.append("Python Version : %s" % sys.version) report.append("Python API : %s" % sys.api_version) report.append("Kivy Version : %s" % kivy.__version__) report.append("Install path : %s" % os.path.dirname(kivy.__file__)) report.append("Install date : %s" % ctime(os.path.getctime(kivy.__file__))) report_dict["Global"] = report report = [] title("OpenGL") from kivy.core import gl from kivy.core.window import Window report.append("GL Vendor: %s" % gl.glGetString(gl.GL_VENDOR)) report.append("GL Renderer: %s" % gl.glGetString(gl.GL_RENDERER)) report.append("GL Version: %s" % gl.glGetString(gl.GL_VERSION)) ext = None try: gl.glGetString(gl.GL_EXTENSIONS) except AttributeError: pass if ext is None: report.append("GL Extensions: %s" % ext) else: report.append("GL Extensions:") for x in ext.split(): report.append("\t%s" % x) Window.close() report_dict["OpenGL"] = report