Skip to content

Add Rust vortex framework#10833

Open
yp3y5akh0v wants to merge 7 commits intoTechEmpower:masterfrom
yp3y5akh0v:add-vortex
Open

Add Rust vortex framework#10833
yp3y5akh0v wants to merge 7 commits intoTechEmpower:masterfrom
yp3y5akh0v:add-vortex

Conversation

@yp3y5akh0v
Copy link

New Rust framework with all endpoints.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

The following frameworks were updated, pinging maintainers:
vortex: @yp3y5akh0v

Comment on lines +18 to +20
/// Pre-built complete JSON response (rebuilt once/sec).
json_response: [u8; 160],
json_len: usize,
Copy link
Contributor

@joanhey joanhey Mar 2, 2026

Choose a reason for hiding this comment

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

I think than this is not permitted.
Could you explain ?

Copy link
Author

Choose a reason for hiding this comment

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

Sure, I will fix it

Copy link
Member

@msmith-techempower msmith-techempower left a comment

Choose a reason for hiding this comment

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

The crates directory feels like it should be hosted elsewhere. It looks like it's the actual framework being exercised and we wouldn't expect an end-user (e.g., a developer) to have that included in their project.

@yp3y5akh0v
Copy link
Author

@msmith-techempower Didn't know that, thanks. Will move it to a separate repo.

@yp3y5akh0v
Copy link
Author

@joanhey @msmith-techempower I pushed the fixes

// - JSON: high volume
// - DB/queries/updates JSON: medium volume
// - Fortunes HTML: lower volume
for i in 0..500_000u32 {
Copy link
Member

Choose a reason for hiding this comment

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

This is very confusing to me - can you explain to me how (and where to look in the code) the json test is implemented? I see the comment // Single JSON response below, but I don't see any allocations.

Also, this loop has me confused as well.

Copy link
Author

Choose a reason for hiding this comment

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

@msmith-techempower This is just a PGO build tool, not the server. The actual code is in the framework repo here

Copy link
Member

Choose a reason for hiding this comment

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

I'm still extremely confused. I'm not sure where the disconnect is, but the only code I would expect to see in this pull request to our repo is application code for starting your framework, declaring and implementing your routes and logic, and a Dockerfile and benchmark_config.json.

Basically, if someone said "I'm looking to start a Vortex project" you could point them to this directory and it should be clear what they need to copy/build.

Copy link
Author

Choose a reason for hiding this comment

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

I see your point. I will make PR cleaner.

joanhey

This comment was marked as duplicate.

Comment on lines +44 to +58
// Realistic fortune data (matches TFB schema)
let fortunes: Vec<(i32, String)> = vec![
(1, "fortune: No such file or directory".into()),
(2, "A computer scientist is someone who fixes things that aren't broken.".into()),
(3, "After enough decimal places, nobody gives a damn.".into()),
(4, "A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1".into()),
(5, "A computer program does what you tell it to do, not what you want it to do.".into()),
(6, "Emacs is a nice operating system, but I prefer UNIX. \u{2014} Tom Christensen".into()),
(7, "Any program that runs right is obsolete.".into()),
(8, "A list is only as strong as its weakest link. \u{2014} Donald Knuth".into()),
(9, "Feature: A bug with seniority.".into()),
(10, "Computers make very fast, very accurate mistakes.".into()),
(11, "<script>alert(\"This should not be displayed in a browser alert box.\");</script>".into()),
(12, "\u{30D5}\u{30EC}\u{30FC}\u{30E0}\u{30EF}\u{30FC}\u{30AF}\u{306E}\u{30D9}\u{30F3}\u{30C1}\u{30DE}\u{30FC}\u{30AF}".into()),
];
Copy link
Contributor

@joanhey joanhey Mar 2, 2026

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

@joanhey I already replied to @msmith-techempower (see comment above).

Copy link
Contributor

Choose a reason for hiding this comment

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

¯\(º_o)/¯

Copy link
Author

Choose a reason for hiding this comment

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

@joanhey @msmith-techempower I removed that file, should be cleaner now. Let me know if anything else looks off.

Copy link
Contributor

@joanhey joanhey Mar 2, 2026

Choose a reason for hiding this comment

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

I'll ask again.
What is this ?
https://github.com/yp3y5akh0v/vortex/blob/master/techempower/src/profgen.rs#L44-L58

PD: https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#fortunes

Using an ORM, all Fortune objects must be fetched from the Fortune table, and placed into a list data structure. Tests that do not use an ORM will be classified as "raw" meaning they use the platform's raw database connectivity.

The list data structure must be a dynamic-size or equivalent and should not be dimensioned using foreknowledge of the row-count of the database table.

And precisely the code for the bench need to be in this repo (not in your repo).

Copy link
Contributor

@joanhey joanhey Mar 2, 2026

Choose a reason for hiding this comment

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

And where is the code that connect to the database? and execute the SQL ?

EDIT: I found the db code.

Copy link
Author

Choose a reason for hiding this comment

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

That's a build-time PGO profiling tool - it runs once during docker build to generate compiler optimization data, then gets thrown away. The hardcoded fortune strings are just dummy input for the profiler. At runtime, fortunes are fetched from the database on every request, no caching. You can see the server code here: https://github.com/yp3y5akh0v/vortex/blob/master/crates/vortex-server/src/server.rs

Copy link
Contributor

@joanhey joanhey Mar 2, 2026

Choose a reason for hiding this comment

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

OK.
But use dummy input, not the same from the database and not exactly a 12 list, as the list size and the content is unknown.

Copy link
Author

Choose a reason for hiding this comment

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

@joanhey This is done

@yp3y5akh0v
Copy link
Author

@joanhey @msmith-techempower Hi, just checking in — all feedback has been addressed. Let me know if anything else is needed.

@joanhey
Copy link
Contributor

joanhey commented Mar 4, 2026

For me is not OK.
The code of the benchmark need to be in this repo. But not the code for the platform.
@msmith-techempower will explain you.

@yp3y5akh0v
Copy link
Author

@joanhey @msmith-techempower benchmark code is now in this repo, got it sorted already

@yp3y5akh0v
Copy link
Author

@joanhey @msmith-techempower any update on this? Benchmark code is in this PR now as requested, and framework code is in my repo.

@volyrique
Copy link
Contributor

Benchmark code is in this PR now as requested...

No, it isn't. How do you explain the fact that your benchmark code does not contain the string Hello, World! at all?

@yp3y5akh0v
Copy link
Author

@volyrique @joanhey @msmith-techempower I have addressed the issues, should be good now. lmk if all good now with this PR

const PLAINTEXT_CT: &[u8] = b"text/plain";
const PLAINTEXT_BODY: &[u8] = b"Hello, World!";
const JSON_CT: &[u8] = b"application/json";
const JSON_BODY: &[u8] = b"{\"message\":\"Hello, World!\"}";
Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#json-serialization

For each request, an object mapping the key message to Hello, World! must be instantiated.

Copy link
Author

Choose a reason for hiding this comment

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

@joanhey JSON serialization is now done per request. Please review when you get a chance.

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