{"id":45324274,"url":"https://github.com/libpag/tgfx-benchmark","last_synced_at":"2026-02-21T08:29:58.122Z","repository":{"id":269685328,"uuid":"905682108","full_name":"libpag/tgfx-benchmark","owner":"libpag","description":"A benchmark project for the TGFX graphics library. ","archived":false,"fork":false,"pushed_at":"2026-02-13T08:21:03.000Z","size":27863,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-13T14:58:10.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tgfx.org/benchmark","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libpag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-19T10:12:12.000Z","updated_at":"2026-02-13T08:21:06.000Z","dependencies_parsed_at":"2025-10-16T07:45:09.223Z","dependency_job_id":null,"html_url":"https://github.com/libpag/tgfx-benchmark","commit_stats":null,"previous_names":["libpag/tgfx-benchmark"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/libpag/tgfx-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Ftgfx-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Ftgfx-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Ftgfx-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Ftgfx-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libpag","download_url":"https://codeload.github.com/libpag/tgfx-benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Ftgfx-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29677482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-21T08:29:57.437Z","updated_at":"2026-02-21T08:29:58.112Z","avatar_url":"https://github.com/libpag.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n A benchmark project for the [TGFX](https://github.com/Tencent/tgfx) graphics library. It is used to \n test the performance of the TGFX graphics library on different platforms.\n\nThere is also a related project, [skia-benchmark](https://github.com/libpag/skia-benchmark), which\ntests the performance of the [Skia](https://skia.org/) graphics library using the same benchmark cases.\n\nYou can also run the benchmark online at [tgfx.org](https://tgfx.org/benchmark) to compare the \nperformance of TGFX and Skia on the web platform.\n\n\n## Getting Started\n\nBefore building the projects, please carefully follow the instructions in the\n[**Build Prerequisites**](https://github.com/Tencent/tgfx?tab=readme-ov-file#build-prerequisites) \nand [**Dependencies**](https://github.com/Tencent/tgfx?tab=readme-ov-file#dependencies) sections.\nThese will guide you through the necessary steps to set up your development environment.\n\n### macOS\nTo get started, open the root directory in CLion. Then, build and run the `Benchmark` target using the\nRelease configuration.\n\nIf you prefer using XCode IDE, go to the root directory, run the following command or double-click\nit:\n\n```\n./gen_mac\n```\n\nThis will generate a project for the native architecture, such as `arm64` for Apple Silicon Macs or\n`x64` for Intel Macs. If you want to generate a project for a specific architecture, use the `-a`\noption, for example:\n\n```\n./gen_mac -a x64\n```\n\nFinally, open Xcode and launch the `mac/TGFX-Benchmark.xcodeproj`. You are all set!\n\n### Windows\n\nTo get started, open the root directory in CLion. Then, go to `File-\u003eSettings` and navigate to\n`Build, Execution, Deployment-\u003eToolChains`. Set the toolchain to `Visual Studio` with either `amd64`\n(recommended) or `x86` architecture. It's also recommended to use the `Ninja` generator for CMake to\nspeed up the build process. You can set this in `Build, Execution, Deployment-\u003eCMake` by choosing\n`Ninja` in the `Generator` row. Once done, build and run the `Benchmark` target using the Release\nconfiguration.\n\nIf you prefer using Visual Studio IDE, open the `x64 Native Tools Command Prompt for VS 2019` and\nrun the following command in the root directory:\n\n```\ncmake -G \"Visual Studio 16 2019\" -A x64 -DCMAKE_CONFIGURATION_TYPES=\"Release\" -B ./win/Release-x64\n```\n\nThis will generate a project for the `x64` architecture with the `Release` configuration. To generate\na project for the `x86` architecture with the `Debug` configuration, open the\n`x86 Native Tools Command Prompt for VS 2019` and run the following command:\n\n```\ncmake -G \"Visual Studio 16 2019\" -A Win32 -DCMAKE_CONFIGURATION_TYPES=\"Debug\" -B ./win/Debug-x86\n```\n\nFinally, open the `Benchmark.sln` file in the `win/Release-x64/` or `win/Debug-x86/` directory, and \nset the `Benchmark` project as the startup project. You are all set!\n\n### Web\n\nTo get started, go to the `web/` directory and run the following command to install the necessary\nnode modules:\n\n```\nnpm install\n```\n\nThen, in the `web/` directory, run the following command to build the demo project:\n\n```\nnpm run build\n```\n\nThis will generate the `benchmark.js` and `benchmark.wasm` files in the `web/demo/wasm` directory.\nNext, you can start an HTTP server by running the following command:\n\n```\nnpm run server\n```\n\nThis will open [http://localhost:8061/web/demo/index.html](http://localhost:8061/web/demo/index.html)\nin your default browser. You can also open it manually to view the demo.\n\nTo debug the C++ code, install the browser plugin:\n[**C/C++ DevTools Support (DWARF)**](https://chromewebstore.google.com/detail/cc++-devtools-support-dwa/pdcpmagijalfljmkmjngeonclgbbannb).\nThen, open Chrome DevTools, go to Settings \u003e Experiments, and enable the option\n**WebAssembly Debugging: Enable DWARF support**.\n\nNext, replace the previous build command with:\n\n```\nnpm run build:debug\n```\n\nWith these steps completed, you can debug C++ files directly in Chrome DevTools.\n\nThe above commands build and run a multithreaded version.\n\n\u003e**⚠️** In the multithreaded version, if you modify the filename of the compiled output benchmark.js, you need to search for\n\u003e the keyword \"benchmark.js\" within the benchmark.js file and replace all occurrences of \"benchmark.js\" with the new filename.\n\u003e Failure to do this will result in the program failing to run. Here's an example of how to modify it:\n\nBefore modification:\n\n```js\n    // filename: benchmark.js\n    var worker = new Worker(new URL(\"benchmark.js\", import.meta.url), {\n     type: \"module\",\n     name: \"em-pthread\"\n    });\n```\n\nAfter modification:\n\n```js\n    // filename: benchmark-test.js\n    var worker = new Worker(new URL(\"benchmark-test.js\", import.meta.url), {\n     type: \"module\",\n     name: \"em-pthread\"\n    });\n```\n\nTo build a single-threaded version, just add the suffix \":st\" to each command. For example:\n\n```\nnpm run build:st\nnpm run build:st:debug\nnpm run serser:st\n``` \n\nTo build the demo project in CLion, open the `Settings` panel and go to `Build, Execution, Deployment` \u003e `CMake`.\nCreate a new build target and set the `CMake options` to:\n\n```\nDCMAKE_TOOLCHAIN_FILE=\"path/to/emscripten/emscripten/version/cmake/Modules/Platform/Emscripten.cmake\"\n```\n\nAfter creating the build target, adjust the `Configurations` to match the new build target. This will\nallow you to build the tgfx library in CLion.\n\nAdditionally, when using `ESModule` for your project, you need to manually include the generated\n`.wasm` file in the final web program. Common packing tools often ignore the `.wasm` file. Also,\nmake sure to upload the `.wasm` file to a server so users can access it.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibpag%2Ftgfx-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibpag%2Ftgfx-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibpag%2Ftgfx-benchmark/lists"}