How to speed up checksum computations of a string? #448
Replies: 5 comments
-
Posted at 2015-09-08 by @gfwilliams Wow, thanks! it's great to see the benchmarks for this. If I'm honest it's a surprise that
But you should be able to use
I just had a quick play and they seem to be 2x or more faster than |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-09-08 by asez73 @gordon, thanks for your time. I am trying it now and just face some errors as compiler server seems to be unjoinable. It is a permanent surprise to see how efficiency can be improved on such a language as javascript. So, let's hope the compiler will be accessible soon. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-09-08 by @gfwilliams Give it a try now - I have no idea what happened there! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-09-08 by asez73 Here are the results on my Espruino board 1v4:
So finally, we have a benefit of 442 % in speed which is obviously reasonnable. Thank's again.Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-09-08 by @gfwilliams Great! I'd still be happier if Espruino executed it more quickly - I'll have to try some benchmarks and see if there's any way to speed up the interpreter a bit more. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-09-08 by asez73
Hi all,
I have been analysing the nmea sentences send from a gps module (ublox neo-6m).
What I ended up with was that checking properly those sentences required to compute the xor of all chars.
So finally, it means looping over a string and that takes 55%, approximately 14ms, of the total time required to handle the sentence which takes 25 ms.
I tried various minifications/looping approaches and the code below show the results
Here are the results
So, is there a way to speed up it?
"compiled" javascript doesn't seem to be possible in this context.
Beta Was this translation helpful? Give feedback.
All reactions