-
flamegraph
Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3 (by flamegraph-rs)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
nokogiri-rust
Discontinued Ruby FFI wrapper around scraper crate to be used instead of Nokogiri. Status: proof of concept.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
I searched over the web how to profile C extensions for Ruby and C code in general, and found out Brendan Gregg’s tutorial on Linux perf. That was my first usage of Linux perf profiler. I’ve also tried gperftools and pprof, because seen its usage. And flamescope, because it was made by Brendan Gregg. There are many similar tools and it was hard to figure out what to use during two weeks or so.
flamescope shows the same as flamegraph. Both of these tools use the same tools to generate chart probably.
I’ve installed perf_data_converter to be able to use perf.data report with pprof.
As of an experiment, I’ve made an FFI wrapper around the Rust scraper crate. at_css.text calls of proof of concept are 60 times faster than Nokogiri ones.
Haven’t tried to use bcc for tracing and profiling.
I’m glad to have the opportunity to contribute to an open-source project that is used by thousands of people. Hopefully, we will speed up Nokogiri (or XML parser it uses) to match the performance of html5ever or lexbor at some point in the future. 800 ms to extract data from HTML is still too much.
c function is not very helpful to find the performance problem, so we dug deeper.
It worked because CFLAGS are passed here and there in ext/nokogiri/extconf.rb.
Haven’t read the entire documentation about perf.
Julien Khaleghy also tried Oga gem instead of Nokogiri. It was about six times faster than Nokogiri.
But some tests were failing with LL::ParserError from ruby-ll that is used in Oga.