Understanding bitwise operations in javascript

后端 未结 4 1524
时光说笑
时光说笑 2020-12-15 01:36

I am currently storing data inside an XML doc as binary, 20 digits long, each representing a boolean value.



        
4条回答
  •  爱一瞬间的悲伤
    2020-12-15 02:24

    Bitwise operators will certainly be faster but only linearly and not by much. You'll probably save a few milliseconds (unless you're processing HUGE amounts of data in Javascript, which is most likely a bad idea anyway).

    You should think about profiling other code in your loop to see what's slowing it down the most. What other algorithms, data structures and allocations do you have in there that could use refactoring?

提交回复
热议问题