Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You can check out the fork that doesn't assume a specific
encode_utf8
implementation and that favors ASCII input.it's 10 times faster than the most popular solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
bouncing_ball(1., 0.5, 0.25)
will return 5 instead of 3 herethis is a thousand times slower than it could be
When I run your benchmark with a 10M random file, I get 307.73ms, 37.92ms and 74.46ms, which is close to what I had. However, when I run it without
--release
, I get 7.26s, 319.00ms, 206.36ms, which is similar to your result. So maybe you were missing the compiler optimizations?In my benchmark I get:
Here I see a 10x boost instead of a 90x boost.
So may I know how your benchmark is organized?
Mine is as follows:
Nice. There is a typo though: in emit_instructions_recursive you have PO instead of PU. Also,
move_immediate_to_rhs
can swap the operands of division or subtraction.It simplifies the code, of course, but it also makes it about 8 times slower.
Exponentiation is a difficult operation, I made it faster by introducing a 10 element table of precomputed powers.
Check out the improved version (the fork). It's 15 times faster than the
format!
way.Nice. The 3
push
es make encoding 10 times slower though.Loading more items...