{"id":26731756,"url":"https://github.com/3noch/primitive-profiling-parser","last_synced_at":"2025-03-28T00:37:58.045Z","repository":{"id":141673535,"uuid":"43822143","full_name":"3noch/primitive-profiling-parser","owner":"3noch","description":"A very primitive parser for very primitive file-based profiling output. Use this when you need to do quick-and-dirty profiling by writing to a file.","archived":false,"fork":false,"pushed_at":"2014-05-22T15:00:58.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T07:01:59.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"CovenantEyes/primitive-profiling-parser","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3noch.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":"2015-10-07T14:39:04.000Z","updated_at":"2015-10-07T14:39:05.000Z","dependencies_parsed_at":"2023-03-13T10:29:56.313Z","dependency_job_id":null,"html_url":"https://github.com/3noch/primitive-profiling-parser","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/3noch%2Fprimitive-profiling-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3noch%2Fprimitive-profiling-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3noch%2Fprimitive-profiling-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3noch%2Fprimitive-profiling-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3noch","download_url":"https://codeload.github.com/3noch/primitive-profiling-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245949550,"owners_count":20698916,"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":"2025-03-28T00:37:56.500Z","updated_at":"2025-03-28T00:37:58.044Z","avatar_url":"https://github.com/3noch.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"P3 Overview\r\n===========\r\n\r\nThe **Primitive Profiling Parser** (or *P3*) is a tiny tool to calculate averages from the\r\nfile-based output of a hand-rolled profiler.\r\n\r\nHere's how it works:\r\n\r\nYour profiler must write a file with two columns (separated by a tab character).\r\nThe first column must contain some identifer (like a function name) and the second\r\ncolumn must contain a decimal number representing how long the identified entity ran.\r\n\r\nWhen you have such a file, run `p3` like this:\r\n\r\n    $ p3 \u003cfilename\u003e\r\n\r\nor like this:\r\n\r\n    $ cat \u003cfilename\u003e | p3\r\n\r\nand you will get the average time spent for each unique entity along with some other information.\r\n\r\n\r\nExample\r\n-------\r\n\r\nLet's say your program keeps appending to a file called `data.txt`. A small cross-section of\r\n`data.txt` could look something like this:\r\n\r\n    groupLogsByUser\t0.00500\r\n    ApiActivityLogger::sendLogsForUser\t2.25004\r\n    ApiActivityLogger::sendLogsForUser\t2.24770\r\n    ApiActivityLogger::sendLogsForUserInBatches\t4.52228\r\n    SqliteLogGatherer::resolveLogs\t0.05343\r\n    ApiActivityLogger::logActivity\t4.59713\r\n    getMaxIdFromQueryResult\t0.00571\r\n    SqliteQueuedLogGatherer::getQueryResult\t1.42582\r\n    SqliteLogGatherer::convertRowToLog\t0.00208\r\n    SqliteLogGatherer::convertRowToLog\t0.00020\r\n    Total\t11.06091\r\n\r\nwhere the first column is some unique name and the second is the time spent for that entity.\r\n\r\nRunning `p3 data.txt` will give you something like this to `stdout`:\r\n\r\n    ID                                                AVERAGE                  COUNT           SUM\r\n    getMaxIdFromQueryResult                           5.687253886010365e-3     x193            =1.0976400000000004\r\n    SqliteQueuedLogGatherer::getQueryResult           1.0012469430051805       x193            =193.24065999999982\r\n    SqliteLogGatherer::convertRowToLog                8.205776706964147e-4     x385583         =316.4008000001357\r\n    SqliteLogGatherer::getLogs                        6.323538906250004        x192            =1214.1194700000008\r\n    groupLogsByUser                                   5.138593749999997e-3     x192            =0.9866099999999995\r\n    ApiActivityLogger::sendLogsForUser                2.2612985937500003       x384            =868.3386600000001\r\n    ApiActivityLogger::sendLogsForUserInBatches       4.543974554973821        x191            =867.8991399999999\r\n    SqliteLogGatherer::resolveLogs                    6.470340314136125e-2     x191            =12.358349999999998\r\n    ApiActivityLogger::logActivity                    4.6310171204188455       x191            =884.5242699999995\r\n    Total                                             10.965333507853408       x191            =2094.378700000001\r\n\r\n\r\nBuilding\r\n========\r\n\r\nTo build, run the following:\r\n\r\n    $ cabal build\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3noch%2Fprimitive-profiling-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3noch%2Fprimitive-profiling-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3noch%2Fprimitive-profiling-parser/lists"}