Hacker Newsnew | past | comments | ask | show | jobs | submit | more parttimenerd's commentslogin

Sometimes all you need is a list to find all the used classes, methods, and functions of a Python module, to proceed with your secret side project. Using sys.settrace makes it possible to write a small helper tool for this purpose with ease.

I'm the author, AMA.


That's pretty cool. We could have a chat (me@<blog-url> is my mail address), if you like, I'm always interested in people using profilers in the real-world :)


I'm the author, ask me things.


Just some feedback. Maybe explain what JFR is for the random visitors that have no clue. If you did then I apologize for missing it.


Agreed. In the first picture, you can see it stands for "Java FlightRecorder," but there's no explanation of what that is or does. A profiler?


Second this. Even when someone said it was in screen shot, it took a minute to go back and refocus to find it.

But. No knock on this guy. I find all STEM writing could be helped a little with some up front what/why/how in introduction.

I want to dig this, but on first scan through, I have no idea what this is doing or why it is cool. So, for getting an article out, if I'm a casual that isn't a die hard user of JFR, then what makes me want to dig deeper? Of course, maybe the goal isn't a wider readership.


I linked now to articles that provide you with more information.


I did go look up JFR when I had no idea what it was. I was just trying to give them a gentle suggestion that explaining the tool, even in 1 sentence, would be helpful.


Thanks for the feedback, I added a small disclaimer at the beginning of the article, telling the reader what JFR is and where to find more information.


That's perfect, thanks!


The Minecraft Wiki community is moving away from Fandom to the self-hosted https://minecraft.wiki/. Could you update your article to reflect that, by any chance?

Edit: Wow! You've never played Minecraft before? That's crazy!


Thanks, I fixed it.

> Edit: Wow! You've never played Minecraft before? That's crazy!

I don't play computer games (the last game I played was "Thomas was alone"), but I know people that play it more often.

Edit: Link to the game https://de.wikipedia.org/wiki/Thomas_Was_Alone. Nowadays, I like to play whack-a-mole with bugs in the OpenJDK.


Thanks! And thank you for your work :)


I'm happy for any reader of my blog :)


Can you give some real world examples when to use JFR custom events? The Minecraft example is not helpful when I know nothing about Minecraft.


I've written about two applications of custom JFR events in the past:

* Monitoring invocations of a REST API: https://www.morling.dev/blog/rest-api-monitoring-with-custom...

* Tracking SQL queries issued by your ORM: https://www.javaadvent.com/2021/12/keep-your-sql-in-check-wi...

The latter is about injecting event-emitting code with a Java Agent rather than manually implementing custom events (latest Hibernate ORM version comes with JFR support OOTB, too).


Thank you Gunnar, I linked to your blog post (and even linked to it already in my previous blog post "Custom JFR Events: A Short Introduction" https://mostlynerdless.de/blog/2023/11/20/custom-jfr-events-...)


> Monitoring invocations of a REST API

Yep, we use custom JFR events to track API calls and correlate them to other built-in JFR events and statistics (garbage collection, memory use, allocations, CPU use, deadlocks, etc).


You might be interested in a proposal by Jaroslav Bachorik to add context into JFR. I wrote a short introduction on my blog "Putting JFR into Context" (https://mostlynerdless.de/blog/2023/10/19/putting-jfr-into-c...)


What's your recommendation about learning how to properly use JFR and Java mission control?


I collected some information here: https://mostlynerdless.de/profiling-talks/


Thanks!


I'm the author, ask me things. Comparing Virtual Threads to Hyper-Threading helped me to comprehend the pros and cons of using these new threads :)


3.12 adds new APIs (see blog post), but there are 3 other parts of the series that use an older Python API.


I wrote a small profiler in ~240 lines of pure Java code: https://github.com/parttimenerd/tiny-profiler

It is reasonable fast :)


Pretty cool!


4-part series on writing a Python debugger from scratch, using old and new APIs.


You should consider prefixing your articles with Show HN: so they get better attention and even more direct feedback.

I'm assuming this might be your work anyway, feel free to correct me if I'm wrong.

As an aside, I've bookmarked the article, this feels like something that will provide some insight into Python specifics I had no idea existed.


Show HN is not really for serial writing or most types of online reading material. Take a look at https://news.ycombinator.com/showhn.html


I agree, but it's also a good idea to post a comment explaining you are the author as the OP did.


Thank you, it was my first submission :)


Probably better to be a little more explicit than a summary of what the page is about (lots of people habitually paste these in, whether they are the author or not) if you want to post a first comment - I'm the author, ask me things, here's an interesting bit from article, etc. You can also skip it, of course, but you know. Be you, don't be a tldr :)


It's an interesting new API. I hope to write a blog post on implementing a debugger with it soon.



I would rather use Andrei Pangin's async-profiler than doing something custom with jstack.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: