{"id":13569198,"url":"https://github.com/satanson/cpp_etudes","last_synced_at":"2025-04-05T12:07:32.722Z","repository":{"id":39968175,"uuid":"275626395","full_name":"satanson/cpp_etudes","owner":"satanson","description":"smart tools for source code study : cpptree.pl, calltree.pl, javatree.pl, java_calltree.pl","archived":false,"fork":false,"pushed_at":"2024-02-03T06:51:24.000Z","size":13749,"stargazers_count":351,"open_issues_count":5,"forks_count":81,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-02-23T16:35:10.516Z","etag":null,"topics":["calltree","perl-script","source-code","source-code-reading","source-code-study","stacktrace"],"latest_commit_sha":null,"homepage":"","language":"C++","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/satanson.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-06-28T16:38:17.000Z","updated_at":"2024-04-23T13:54:32.223Z","dependencies_parsed_at":"2024-04-23T14:04:57.700Z","dependency_job_id":null,"html_url":"https://github.com/satanson/cpp_etudes","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/satanson%2Fcpp_etudes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satanson%2Fcpp_etudes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satanson%2Fcpp_etudes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satanson%2Fcpp_etudes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/satanson","download_url":"https://codeload.github.com/satanson/cpp_etudes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332609,"owners_count":20921853,"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":["calltree","perl-script","source-code","source-code-reading","source-code-study","stacktrace"],"created_at":"2024-08-01T14:00:36.967Z","updated_at":"2025-04-05T12:07:32.693Z","avatar_url":"https://github.com/satanson.png","language":"C++","readme":"# cpp\\_etudes\n\ncpp\\_etudes is a cpp project integrated with google benchmark, google test for validating cpp features and refining vectorized builtin function of databases. It can be\nbuilt by both clang and gcc. Some interesting perl scripts are also included.\n\n\n## Scripts\n### calltree.pl: A smart tool to surf C++ source code\n\nrun commands to get usage of calltree.pl as follows:\n```\ncalltree.pl\ncalltree.pl help\ncalltree.pl -h\ncalltree.pl --help\n```\n\n![image](./images/calltree.png)\n\n\n### csvtable.pl: create a ascii-border table from CSV format.\n\n1. create a csv file\n\n```shell\ncat \u003erepeat.csv  \u003c\u003c'DONE'\nt,vectorization,new-vectorization,non-vectorization,new speedup,vectorization speedup\nrepeat/const_times,3112ms, 9797ms, 13986ms(4X memory),3.14,4.49\nrepeat/const_s, 8107ms, 30231ms, 39501ms(32X memory), 3.72,4.87\nrepeat,9141ms, 32182ms,44315ms(32X memory), 3.52,4.84\nDONE\n```\n\n2. generate a ascii-border table\n\n```\ncat repeat.csv |./csvtable.pl\n\n+====================+===============+===================+=====================+=============+=======================+\n| test               | vectorization | new-vectorization | non-vectorization   | new speedup | vectorization speedup |\n+====================+===============+===================+=====================+=============+=======================+\n| repeat/const_times | 3112ms        | 9797ms            | 13986ms(4X memory)  | 3.14        | 4.49                  |\n| repeat/const_s     | 8107ms        | 30231ms           | 39501ms(32X memory) | 3.72        | 4.87                  |\n| repeat             | 9141ms        | 32182ms           | 44315ms(32X memory) | 3.52        | 4.84                  |\n+--------------------+---------------+-------------------+---------------------+-------------+-----------------------+\n```\n\n### cpptree.pl: show class hierarchy of cpp project in the style of Linux utility tree.\n\n1. usage, try with incubator-doris, other cpp projects are just ok.\n\n```\n# format\n\n./cpptree.pl \u003ckeyword|regex\u003e \u003cfilter\u003e \u003cverbose(0|1)\u003e \u003cdepth(num)\u003e\n- keyword for exact match, regex for fuzzy match;\n- subtrees whose leaf nodes does not match filter are pruned, default value is '' means match all;\n- verbose=0, no file locations output; otherwise succinctly output;\n- depth=num, print max derivation depth.\n\ngit clone https://github.com/satanson/incubator-doris.git\ncd incubator-doris\n\n# show all classes\n./cpptree.pl '\\w+'\n\n# show all classes with file locations.\n./cpptree.pl '\\w+' '' 1\n\n# show all classes exact-match ExecNode if ExecNode class exists\n./cpptree.pl 'ExecNode' '' 1\n\n# show all classes fuzzy-match regex '.*Node$' if the literal class name not exists.\n./cpptree.pl '.*Node$' '' 1\n\n# show all classes and depth of derivation relationship is less than 3\n./cpptree.pl '\\w+' '' 1 3\n\n# show all classes whose ancestor class matches 'Node' and itself or its offsprings matches 'Scan'\n/cpptree.pl 'Node' 'Scan'\n\n```\n2. some outputs\n\n```\ncd incubator-doris\n./cpptree.pl 'ExecNode'\n```\n![image](./images/doris_execnode.png)\n\n\n```\ncd ClickHouse\n./cpptree.pl IProcessor\n```\n![image](./images/clickhouse_iprocessor.png)\n\n\n```\ncd ClickHouse\n./cpptree.pl IDataType '' 1\n```\n![image](./images/clickhouse_idatatype.png)\n\n```\ncd incubator-doris\n./cpptree.pl 'Node' 'Scan'\n```\n![image](./images/doris_node_to_scan.png)\n\n```\ncd ClickHouse\n./cpptree.pl IProcessor Aggregat 1\n```\n![image](./images/clickhouse_iprocessor_to_aggregat.png)\n\n### color\\_palette.pl: show color palette for colorful terminal output.\n\n1. usage\n```\n./color_palette.pl\n```\n\n![image](./images/color_palette.png)\n\n\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatanson%2Fcpp_etudes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsatanson%2Fcpp_etudes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatanson%2Fcpp_etudes/lists"}