Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
gocloc
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Hideo Hattori
January 18, 2019
Technology
590
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
gocloc
https://github.com/hhatto/gocloc
Hideo Hattori
January 18, 2019
More Decks by Hideo Hattori
See All by Hideo Hattori
RustとPython
hhatto
4
2.7k
PyCon APAC 2013 LT
hhatto
0
99
PHP Kansai 2013 LT
hhatto
0
120
Other Decks in Technology
See All in Technology
Kiro 入門 (1 つのエージェントを、どの画面からでも) | 目指せ Kiro マスター 01
inariku
PRO
6
1.3k
令和の今、あらためて IAM を考える。アクセスキーを「無くせない現実」との向き合い方
kazzpapa3
0
540
JAWSコミュニティに 参加して1年経った結果
ssakita
0
120
Sizing, Benchmarking and Performance Tuning Apache Flink Clusters
rmetzger
0
140
公共システムAdventCalendar2026
toru_kubota
0
290
BALLAS Technology Deck
ballas_inc
0
350
Shared Signals Framework 仕様解説
oidfj
0
290
自治体AIコンタクトセンター、何をどこに任せる?~Amazon Connect Customer +Amazon Bedrockの実践知~ / 20261107 Satoshi Torano
shift_evolve
PRO
1
120
IBC 2026 動画技術関連レポート / IBC 2026 Report
cyberagentdevelopers
PRO
2
450
Building Audio Plugin Ecosystem for Android in 2026
atsushieno
2
160
IoTとは〜? 数字で見るSORACOM UG【SORACOM UG Explorer 2026】
soracom
PRO
0
330
バックオフィスに染み出すTypeScript ── clasp で安全に仕組みを作る
nealle
1
200
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Darren the Foodie - Storyboard
khoart
PRO
4
4.1k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
300
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Rails Girls Zürich Keynote
gr2m
96
14k
Mind Mapping
helmedeiros
1
430
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
370
Transcript
gocloc Umeda.go 2019 Winter 2019.01.18
whoami Hideo Hattori (hhatto) 関西圏でソフトウェアエンジニアをしています Rust, Python, Go, C などが好きです
今日お話しすること gocloc 作ってみました 得られた知見
gocloc とは?
gocloc ソースコードの行数を数えるツール Perl 実装のcloc がベース
モチベーション cloc が遅いので速いツールが欲しかった Rust でも同じような実装があったのでGo でもどれ くらい高速になるか試したかった
実行イメージ $ gocloc . Language files blank comment code
Go 13 164 42 1369 Markdown 1 20 0 149 Makefile 1 5 0 14 TOML 1 2 0 9 YAML 1 2 0 8 TOTAL 17 193 42 1549
主な機能 言語毎のファイル数/ 空行数/ コメント行数/ コード 行数の表示 ファイル毎のファイル数/ 空行数/ コメント行数/ コ
ード行数の表示( byfile オプション) 出力結果が多様なフォーマットに対応
得られた知見
得られた知見 goroutine 使わなくてもGo で実装するだけで動作 が軽量なツールが実装できる シングルバイナリでツールを提供できて配布が楽 ファイルの言語判定にはsrc-d/enry を使うとより高 速になる generaltso/linguist
がもともと存在していた が、src-d/enry に切り替えたところ高速に動作 した
得られた知見 boyter/scc というGo の別実装が登場 ファイルの言語判定が自前なので速い goroutine を使っていてgocloc よりさらに高速 gocloc もgoroutine
使えばさらに高速化できる かもしれない ATS という言語で実装されているPolyglot というツ ールが最速
合わせて読むと良いかもしれないリンク集 gocloc - fast cloc implementation | hexacosa.net 実装初期にまとめたgocloc 誕生の経緯など
Sloc Cloc and Code Revisited - Optimizing an already fast Go application | Ben E. C. Boyter Yet Another なGo で実装されたcloc クローン。 gocloc より速い!! Polyglot Is the Fastest Code-counting Tool Available Polyglot という最速のcloc クローン。ATS という 言語で実装されている
Thank you!!