Skip to content

add codspeed#4461

Merged
jussisaurio merged 7 commits intotursodatabase:mainfrom
pedrocarlo:codspeed
Jan 14, 2026
Merged

add codspeed#4461
jussisaurio merged 7 commits intotursodatabase:mainfrom
pedrocarlo:codspeed

Conversation

@pedrocarlo
Copy link
Copy Markdown
Collaborator

@pedrocarlo pedrocarlo commented Jan 5, 2026

Description

Add CodSpeed to also monitor benchmarks and have access to some other nice features: https://codspeed.io/docs/features/profiling

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jan 6, 2026

Congrats! CodSpeed is installed 🎉

🆕 353 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks


ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Open in CodSpeed

@pedrocarlo pedrocarlo marked this pull request as ready for review January 6, 2026 02:10
Copy link
Copy Markdown

@turso-bot turso-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review @sivukhin

@pedrocarlo pedrocarlo force-pushed the codspeed branch 3 times, most recently from 1a54244 to 8eb0e7c Compare January 6, 2026 02:57
@art049
Copy link
Copy Markdown

art049 commented Jan 6, 2026

Hey @pedrocarlo, just checking how the integration is going 😄

Normally, you don't need to import directly from codspeed-criterion-compat

You can rename the package during the install so it doesn't require code changes in the benchmarks:

criterion = { package = "codspeed-criterion-compat", version = "*" }

Or did doing it create some compatibility issues?

@pedrocarlo
Copy link
Copy Markdown
Collaborator Author

Hi @art049,



Thanks for checking in on us! 

We currently use the pprof profiler for Criterion, and pprof hasn’t upgraded their Criterion dependency to 0.8.1. I don’t know exactly what version Codspeed is using for the criterion-compat, but it is incompatible with the profiler. So the easiest thing for me to do was to just gate the compat crate under a feature flag and disable the profiler for codspeed. 



While you are here, do you know why codspeed emitted this notice for the tpc-h-benchmark? 

NOTICE: codspeed is enabled, but no performance measurement will be made since it's running in an unknown environment.



Did I do the setup wrong for this benchmark?
https://github.com/tursodatabase/turso/actions/runs/20736437443/job/59534571622?pr=4461

@art049
Copy link
Copy Markdown

art049 commented Jan 6, 2026

While you are here, do you know why codspeed emitted this notice for the tpc-h-benchmark? 

NOTICE: codspeed is enabled, but no performance measurement will be made since it's running in an unknown environment.



Thanks for bringing this up, this is a bug that was introduced in the latest release. Will be fixed with CodSpeedHQ/codspeed-rust#158

Make sense for pprof. I didn't know this was the reason.

@pedrocarlo pedrocarlo force-pushed the codspeed branch 4 times, most recently from e528cb8 to cd0b92e Compare January 7, 2026 15:42
@GuillaumeLagrange
Copy link
Copy Markdown

Hey @pedrocarlo

We have released v4.2.1 of our rust integrations, which fixes the erroneous warning.

I'm also starting to look into why the trace generation was not successful, I'll keep you up when I find anything.

@GuillaumeLagrange
Copy link
Copy Markdown

GuillaumeLagrange commented Jan 8, 2026

Hello @pedrocarlo

Looking into it, I found that the profiling data generation actually succeeded for the example that you pointed out, but we failed to save it because one of the benchmarks has an URI that is too long.

That's definitely on us, we're working on making sure things do not break if the URI is too long, are at least to make sure that things break with an actionable feedback for the user. We'll fix this asap and let you know when the fix has been deployed!

@GuillaumeLagrange
Copy link
Copy Markdown

GuillaumeLagrange commented Jan 8, 2026

FYI, the offender is the bench with the name
limbo_parse_query[SELECT first_name, last_name, state, city, age + 10, LENGTH(email), UPPER(first_name), LOWER(last_name), SUBSTR(phone_number, 1, 3), zipcode || '-' || state, AVG(age) + 5, MAX(age) - MIN(age), ROUND(AVG(age), 1), SUM(age) / COUNT(*), COUNT(*), COUNT(email), SUM(age), AVG(age), MIN(age), MAX(age), SUM(CASE WHEN age >= 18 THEN 1 ELSE 0 END), SUM(CASE WHEN age < 18 THEN 1 ELSE 0 END), AVG(CASE WHEN age >= 18 THEN age ELSE NULL END), MAX(CASE WHEN age >= 18 THEN age ELSE NULL END) FROM users GROUP BY state, city]

If you change it so a shorter ID, it should work immediately.

What we intend to change is to have an explicit error message when this happens, so this is a change that you will have to do anyway.

@pedrocarlo pedrocarlo force-pushed the codspeed branch 3 times, most recently from cb7b440 to b6cd81d Compare January 8, 2026 19:35
@jussisaurio
Copy link
Copy Markdown
Collaborator

thread 'tokio-runtime-worker' panicked at stress/main.rs:894:33:
thread#1 integrity check failed: Text("NULL value in hard_fish_311.slow_moon_468")

Hmm... this is highly likely to be the New And Improved ™️ Integrity check reporting a false positive. Should still check though

@pedrocarlo
Copy link
Copy Markdown
Collaborator Author

pedrocarlo commented Jan 8, 2026

Uhm I don't remember if I rebased with your changes that you just merged.

PThorpe92 added a commit that referenced this pull request Jan 8, 2026
…ussi Saurio

TLDR: if a table had INTEGER PRIMARY KEY NOT NULL, it was reporting all
of the keys as NULL because the record stores a NULL for rowid aliases
(since the rowid is already stored separately).
This failed `stress` on Pedro's PR #4461

Reviewed-by: Pedro Muniz (@pedrocarlo)
Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #4534
@pedrocarlo
Copy link
Copy Markdown
Collaborator Author

Hey @GuillaumeLagrange,

Awesome thanks for looking into it. I truncated the test names and now I can see a bunch traces for the benchmarks!

Can I bother you hopefully one last time? The TPC-H benchmark for some reason is timing out. However, in this other CI run we have it does not: https://github.com/tursodatabase/turso/actions/runs/20831566769/job/59846777522?pr=4461

Do you know what might be the reason? Is there something I should be doing from my side?

@GuillaumeLagrange
Copy link
Copy Markdown

@pedrocarlo are these benchmark heavily multithreaded ?

We've had cases where we observed deadlocks in simulation mode due to how valgrind flattens the thread executions. For these cases we generally recommend trying out our walltime instrument.

I'll let you know if I find anything.

@pedrocarlo
Copy link
Copy Markdown
Collaborator Author

Hi @GuillaumeLagrange,

Thanks! They are all single threaded!

@jussisaurio jussisaurio merged commit bdc03f5 into tursodatabase:main Jan 14, 2026
61 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants