frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: Timep – a next-gen profiler and flamegraph-generator for bash code

https://github.com/jkool702/timep
19•jkool702•1d ago
timep is a TIME Profiler for bash code that will give you an accurate per-command execution time breakdown of any bash script or function.

Unlike other profilers, timep also recovers and hierarchally records metadata on subshell and function nesting, allowing it to recreate the full call-stack tree for the bash code being profiled. If you call timep with the `--flame` flag, it will automatically generate a flamegraph .svg image where each block represents the wall-clock time spent on a particular command (top level) or its parent subshells/functions (all the other levels).

Using timep is simple - just source the timep.bash file then add timep before whatever you want to profile. You do not need to change in the code being profiled - timep handles everything for you. Example usage:

  . ./timep.bash
  timep someFunc
  timep -flame someScript <inputFile
timep will generate 2 profiles for you: one showing each individual command (with full subshell/function nesting chains), and one that combines repeated loops commands into a count + total runtime line with minimal "extra" metadata.

See the github README for more info on the available flags and output profile specifics.

timep works by cramming all the timing instrumentation logic into a DEBUG trap that roughly does the following:

1. record end timestamp for previous command 2. compare current state to state saved in variables last DEBUG trap to determine what sort of command is happening. e.g., if BASH_SUBSHELL increased then we know we just entered a subshell or background fork. 3. once we know what type of command is happening, generate a log line for the previous command (now that we have its end time 4. save current state in various variables (for use next debug trap) 5. record start time for the next command

then after the profiled code is done running, timep post-processes the logs to produce the final profile

Comments

jkool702•6h ago
Im currently working on adding the ability to record user/sys cpu time (in addition to wall-clock time) to timep. This will be coupled with a new modification to the timep_flamegraph.pl script that will control the flamegraph coloring saturation based on cpu time (sys+usr) - lower cpu time will be more faded and higher cpu time will be more vivid/saturated.

those interested can see the current progress in the "timep_testing" branch of the github repo. The trap timing instrumentation and the new flamegraph script are both done, but post-processing the new cpu times is a work-in-progress. The new flamegraph script is backwards-compatible with the current timep, so you can tryout that part now if you want.

“Reading Rainbow” was created to combat summer reading slumps

https://www.smithsonianmag.com/smithsonian-institution/to-combat-summer-reading-slumps-this-timeless-childrens-television-show-tried-to-bridge-the-literacy-gap-with-the-magic-of-stories-180986984/
115•arbesman•4h ago•25 comments

Ex-Waymo engineers launch Bedrock Robotics to automate construction

https://techcrunch.com/2025/07/16/ex-waymo-engineers-launch-bedrock-robotics-with-80m-to-automate-construction/
262•boulos•12h ago•211 comments

Original Xbox Hacks: The A20 CPU Gate

https://connortumbleson.com/2021/07/19/the-xbox-and-a20-line/
21•mattweinberg•1h ago•0 comments

I want an iPhone Mini-sized Android phone (2022)

https://smallandroidphone.com/
161•asimops•8h ago•212 comments

I was wrong about robots.txt

https://evgeniipendragon.com/posts/i-was-wrong-about-robots-txt/
53•EPendragon•4h ago•36 comments

AI therapy bots fuel delusions and give dangerous advice, Stanford study finds

https://arstechnica.com/ai/2025/07/ai-therapy-bots-fuel-delusions-and-give-dangerous-advice-stanford-study-finds/
186•pseudolus•3d ago•89 comments

Altermagnets: The first new type of magnet in nearly a century

https://www.newscientist.com/article/2487013-weve-discovered-a-new-kind-of-magnetism-what-can-we-do-with-it/
306•Brajeshwar•14h ago•75 comments

Show HN: A 'Choose Your Own Adventure' written in Emacs Org Mode

https://tendollaradventure.com/sample/
91•dskhatri•7h ago•8 comments

The 1960s schools experiment that created a whole new alphabet

https://www.theguardian.com/education/2025/jul/06/1960s-schools-experiment-created-new-alphabet-thousands-children-unable-to-spell
28•Hooke•1d ago•23 comments

Inside the box: Everything I did with an Arduino starter kit

https://lopespm.com/hardware/2025/07/15/arduino.html
24•lopespm•1d ago•2 comments

Intel's retreat is unlike anything it's done before in Oregon

https://www.oregonlive.com/silicon-forest/2025/07/intels-retreat-is-unlike-anything-its-done-before-in-oregon.html
110•cbzbc•10h ago•163 comments

Blue Pencil no. 18–Some history about Arial

https://www.paulshawletterdesign.com/2011/09/blue-pencil-no-18%e2%80%94some-history-about-arial/
23•Bluestein•2d ago•4 comments

Pgactive: Postgres active-active replication extension

https://github.com/aws/pgactive
277•ForHackernews•20h ago•71 comments

Gaslight-driven development

https://tonsky.me/blog/gaslight-driven-development/
103•theodorejb•4h ago•64 comments

Show HN: Improving search ranking with chess Elo scores

https://www.zeroentropy.dev/blog/improving-rag-with-elo-scores
145•ghita_•14h ago•46 comments

Mistakes Microsoft made in the Xbox security system (2005)

https://xboxdevwiki.net/17_Mistakes_Microsoft_Made_in_the_Xbox_Security_System
43•davikr•4h ago•12 comments

How and where will agents ship software?

https://www.instantdb.com/essays/agents
114•stopachka•11h ago•56 comments

Artisanal handcrafted Git repositories

https://drew.silcock.dev/blog/artisanal-git/
131•drewsberry•9h ago•31 comments

I'm switching to Python and actually liking it

https://www.cesarsotovalero.net/blog/i-am-switching-to-python-and-actually-liking-it.html
380•cesarsotovalero•21h ago•572 comments

Shipping WebGPU on Windows in Firefox 141

https://mozillagfx.wordpress.com/2025/07/15/shipping-webgpu-on-windows-in-firefox-141/
358•Bogdanp•22h ago•145 comments

Signs of autism could be encoded in the way you walk

https://www.sciencealert.com/signs-of-autism-could-be-encoded-in-the-way-you-walk
113•amichail•10h ago•111 comments

Remembrance of Scents Past

https://www.newyorker.com/culture/onward-and-upward-with-the-arts/remembrance-of-scents-past
9•prismatic•2d ago•1 comments

A Rust shaped hole

https://mnvr.in/rust
67•vishnumohandas•1d ago•117 comments

Roman dodecahedron: 12-sided object has baffled archaeologists for centuries

https://www.livescience.com/archaeology/romans/roman-dodecahedron-a-mysterious-12-sided-object-that-has-baffled-archaeologists-for-centuries
54•bookofjoe•2d ago•84 comments

Show HN: Cobble – A hard daily word game

https://wilf.live/cobble/
15•wolfred•4h ago•7 comments

Chain of thought monitorability: A new and fragile opportunity for AI safety

https://arxiv.org/abs/2507.11473
109•mfiguiere•14h ago•50 comments

Show HN: 0xDEAD//TYPE – A fast-paced typing shooter with retro vibes

https://0xdeadtype.theden.sh/
70•theden•4d ago•19 comments

Scanned piano rolls database

http://www.pianorollmusic.org/rolldatabase.php
37•bookofjoe•4d ago•10 comments

The battle for Britain’s first book of the month club

https://www.historytoday.com/archive/history-matters/battle-britains-first-book-month-club
9•samclemens•2d ago•1 comments

Weave (YC W25) is hiring an AI engineer

https://www.ycombinator.com/companies/weave-3/jobs/SqFnIFE-founding-ai-engineer
1•adchurch•12h ago