rust data loader example#1452
Conversation
| @@ -0,0 +1,163 @@ | |||
| #!/usr/bin/env rust-script | |||
| //! Since Framework uses rust-script, we can define dependencies here. | |||
There was a problem hiding this comment.
Yeah this is really cool
| // Displays both large and small percentages by adding decimal places | ||
| // until there is something besides zeroes, or until the limit is hit. |
There was a problem hiding this comment.
Neat! Another “trick” I like with percentages is to not round 0.99999 to 100% but display it as 99.9% (not applicable here, but I can see this function being reused in other contexts).
|
Just a few nitpicking comments :) It's a great example! |
|
As well as the review feedback, I made a fairly mechanical conversion of the Rust data loader into TypeScript, to get a speed comparison. Unsurprisingly, the Rust example is much faster, about 65x faster on my system. 20x of that can be theoretically attributed to parallelism, leaving a ~3x language speed up. I'm not sure if this should be included in the example though. What do you all think? |
|
I like the idea! |
For our recent data loaders, I had prepared two examples, but only had time to demo one of them in the presentation. This is the other one, a data loader example that uses Rust to simulate 10 million poker hands and reports the probability of getting each hand.