{"id":15982727,"url":"https://github.com/ematipico/js-performance","last_synced_at":"2025-10-29T04:41:59.992Z","repository":{"id":57111316,"uuid":"93518679","full_name":"ematipico/js-performance","owner":"ematipico","description":"A collection of utilities to measure the performance of your application","archived":false,"fork":false,"pushed_at":"2018-01-06T12:24:09.000Z","size":157,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T21:47:11.003Z","etag":null,"topics":["javascript","library","performance","utility"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ematipico.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-06T12:58:35.000Z","updated_at":"2017-07-29T18:02:54.000Z","dependencies_parsed_at":"2022-08-21T11:00:18.295Z","dependency_job_id":null,"html_url":"https://github.com/ematipico/js-performance","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ematipico%2Fjs-performance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ematipico%2Fjs-performance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ematipico%2Fjs-performance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ematipico%2Fjs-performance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ematipico","download_url":"https://codeload.github.com/ematipico/js-performance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234943,"owners_count":20905855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["javascript","library","performance","utility"],"created_at":"2024-10-08T01:21:30.258Z","updated_at":"2025-10-29T04:41:59.942Z","avatar_url":"https://github.com/ematipico.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript Performance\n\nJavaScript performance is a collection of utilities that can help you to give information about the performance of your application.\n\nBear in mind that this **is not a jsperf** sibling, but it's more focused on something else.\n\nThe library is simply a easy way to take advantage of the browser API `performance`\n\n## Why JavaScript Performance?\n\nThe browser API `performance` is useful but it takes a bit to understand the APIs and make an effective use inside your application.\n\nThe aim of the library is just to give few functions with almost zero learning curve.\n\n## How to install\n\nJust run the following command\n\n```bash\nnpm install --save @ematipico/js-performance\n```\n\n## How to import it\n\nImport the library in the way of prefer most, from your browser\n\n```html\n\u003cscript src='path/to/js.performance.umd.js'\u003e\u003c/script\u003e\n\u003cscript\u003e\n  JSPerf.startRecording()\n\n  // etc.\n\u003c/script\u003e\n\n```\nOr straight inside your modules if you are using bundler such as webpack or rollup\n\n```javascript\nimport { startRecording } from 'js-perf'\n\nstartRecording()\n// etc.\n\n```\n\n**The library doesn't support Node.js environments for obvious reasons, as it doesn't have a `performance` API.**\n\n## How to use it\n\nThe following example will use ES6 modules and it will be really simple\n\n```JavaScript\nimport { startRecording, startMark, stopMark, stopRecording, allMeasures  } from 'js-perf'\n\nstartRecording()\n\nstartMark('firstLoop')\nfor (let i = 0; i \u003c 100; i++) {\n  // operation\n}\nstopMark('firstLoop')\n\nstartMark('secondLoop')\nfor (let i = 0; i \u003c 100; i++) {\n  // operation\n}\nstopMark('secondLoop')\nstopRecording()\nallMeasures() // this will print inside your console the results of your marks\n\n```\n\nIt's easy!\n\n***Note: at the moment the library does not support having two marks with the same name***\n\nThat means that executing the following code won't work\n\n```JavaScript\nimport { startRecording, startMark, stopMark, stopRecording  } from 'js-perf'\n\nstartRecording()\nstartMark('operation')\nstartMark('operation')\n\n// expensive operation\n\nstopMark('operation')\nstopMark('operation')\nstopRecording()\n\n```\n\nThe result will be just ONE mark called 'operation'\n\n## APIs\n\nA list of available APIs is [here](./API.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fematipico%2Fjs-performance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fematipico%2Fjs-performance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fematipico%2Fjs-performance/lists"}