0

I am trying to make my server run little faster by moving some methodes to the client side. One of these method calls in c#:

for(i=0; i<buffer.Length;i++) {
    float j = (float)BitConverter.ToInt16(buffer, i); 
    // ... 
}

is there any equivalent for BitConverter.ToInt16 on javascript side ?

I found this answer , i tried to change the type to match ToInt16 but it did not work , it gives me InvalidArgument.

PS : ashamed

Mehdi Souregi
  • 3,153
  • 5
  • 36
  • 53
  • the result of this method is not critical, i use this points just to draw a wave form – Mehdi Souregi Dec 12 '17 at 12:32
  • 1
    "I am trying to make my server run little faster by moving some methodes to the client side." My guts tell me this is very wrong to do. Did you really tried your very best to improve performance throughout your application? – Mixxiphoid Dec 12 '17 at 12:33
  • the application is still under developement it is not on production yet :), i am just trying to make it run on the best conditions – Mehdi Souregi Dec 12 '17 at 12:35
  • 1
    That makes it even worse. Optimization tweaks should be one of the lasts steps in your development cycle. You will probably face more problems if you start optimizing now. When your product is production-ready run some benchmarks on critical paths and fix those bottlenecks, after that start worrying about minor tweaks like this. I might come across a bit stiff, I don't mean any offence, but please consider my warning. – Mixxiphoid Dec 12 '17 at 12:38
  • Remember that users don't care how fast your server is, rather how fast the overall experience is. While offloading work to JS might make things look good from your end, if you end up having to deliver more data and use (potentially slower) JS on the client, it all adds up to a worse experience for the user. I agree with @Mixxiphoid - get it all working properly end-to-end, then use some performance diagnostic tools to see where the slow bits are. – James Thorpe Dec 12 '17 at 12:42
  • I just wanna move on the method that draws a wave form from server side to the client side because it is not critical like i said, it should not be on server side at first place, dont get me wrong i know guys what you are trying to explain, and the decision to move on those method is not only mine so here i am trying to read the c# source code of this method and what it does exaclty – Mehdi Souregi Dec 12 '17 at 12:48

0 Answers0