{"id":19030510,"url":"https://github.com/sofish/performance.js","last_synced_at":"2025-09-13T13:05:18.893Z","repository":{"id":143449411,"uuid":"7437141","full_name":"sofish/performance.js","owner":"sofish","description":"calculate performance timing for web page","archived":false,"fork":false,"pushed_at":"2013-03-26T00:50:28.000Z","size":107,"stargazers_count":46,"open_issues_count":1,"forks_count":9,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-23T16:04:07.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sofish.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-04T08:06:06.000Z","updated_at":"2020-10-29T09:59:04.000Z","dependencies_parsed_at":"2023-03-18T14:16:48.994Z","dependency_job_id":null,"html_url":"https://github.com/sofish/performance.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Fperformance.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Fperformance.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Fperformance.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Fperformance.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sofish","download_url":"https://codeload.github.com/sofish/performance.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250468273,"owners_count":21435452,"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":[],"created_at":"2024-11-08T21:18:19.741Z","updated_at":"2025-04-23T16:04:13.952Z","avatar_url":"https://github.com/sofish.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Page Performance\n\n### 1. Usage:\n\nInstall the `performance.js` file in the page, and listen to the `perf` event:\n\n```html\n\u003cscript src=\"./performance.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nwindow.addEventListener('perf', function(perf) {\n  console.log(perf.detail);\n})\n\u003c/script\u003e\n```\n\n### 2. the `perf.detail` object\n\n#### 2.1 properties\n\n\u003ctable\u003e\u003ctbody\u003e\n\u003ctr\u003e\u003cth\u003elookup\u003c/th\u003e\u003ctd\u003edns, domain lookup for the source\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003cth\u003ewaiting\u003c/th\u003e\u003ctd\u003enetwork latency, waiting before page request start\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003cth\u003ereceiving\u003c/th\u003e\u003ctd\u003eperiod between request start and request end\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003cth\u003eparsing\u003c/th\u003e\u003ctd\u003edom parsing, from dom loading to dom complete\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003cth\u003econtentLoaded\u003c/th\u003e\u003ctd\u003ewe used to call it dom ready \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003cth\u003epageLoaded\u003c/th\u003e\u003ctd\u003efrom user agent start a lookup to load event start\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\n#### 2.2 code to calculate out the properties\n\n```js\n[ 'lookup'        , ['requestStart', 'navigationStart']],\n[ 'waiting'       , ['responseStart', 'requestStart']],\n[ 'receiving'     , ['responseEnd', 'responseStart']],\n[ 'parsing'       , ['domComplete', 'domLoading']],\n[ 'contentLoaded' , ['domContentLoadedEventStart', 'navigationStart']],\n[ 'pageLoaded'    , ['loadEventStart', 'navigationStart']] \n```\n\n#### 2.3 performance life cycle chart\n\n![performance life cycle chart](http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/timing-overview.png)\n\n### 3. Testcase\n\nrun the `testcase.html` file, please!\n\n### 4. License\n\n(c) MIT License\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofish%2Fperformance.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsofish%2Fperformance.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofish%2Fperformance.js/lists"}