SleepPolar
Explore posts from serversProblems changing the value of a reactive signal returned from a function
Thank you for the explanation.
I see that it has potential benefits in terms of performance and memory, although I believe that in my case it would be better to keep my BitBoard in JavaScript. Currently, I don't have practical knowledge about those topics, and it could be a significant challenge to implement them correctly. If in the future I find it to be too slow and I want to improve it even further, I will try to take it into account.
51 replies
Problems changing the value of a reactive signal returned from a function
I tried iterating both to see how long they lasted.
And it was faster: "this.data[byte] |= 1 << bitIndex;". But it seems strange to me that this is faster than using a MASK, if from what I saw on the internet the MASK is used to avoid the "1 << bitIndex", perhaps it is that since the bit offset is up to where bitIndex says, and the maximum value of bitIndex is 8 (1 byte) so it is faster than accessing the MASK element.
I have no idea 🤣
51 replies
Problems changing the value of a reactive signal returned from a function
One last question. Can you recommend me a page where I can do a benchmark, there are many and I don't know if all of them are good, or how do you do the benchmarks? I wanted to make a benchmark of:
this.data[byte] |= 1 << bitIndex; //The maximum bitIndex value would be 8 (1byte)
this.data[byte] |= BIT_MASKS[bitIndex]; //The maximum bitIndex value would be 8 (1byte). BIT_MASKS is a Uint8Array
I know that probably if there is a difference, the difference will be very small, but since the bot will have to do a lot of iterations, I wanted to do a test to see.51 replies
Problems changing the value of a reactive signal returned from a function
Regarding the benchmark, I did not understand the information very well, I do not see the part in which the performance of both is compared 😅. (It doesn't matter though, I was just curious.)
51 replies
Problems changing the value of a reactive signal returned from a function
I think I understood:
Solid/store, both createMutable and createStore, resort to wrapping the object/array with a Proxy, and that has an additional performance cost. This is because the Proxy intercepts read and write operations, executing additional code each time a property is accessed or modified, which introduces overhead.
And the overhead depends on the code that is executed in the Proxy's setter and getter interceptors.
But even though it has an overhead, you said it was very little, and with the benefit it has in terms of ease of use, it is better to use createStore and createMutable instead of using a createSignal (for cases like this)
51 replies
Problems changing the value of a reactive signal returned from a function
Regarding this message, it mentions a performance gap between the two, just out of curiosity which one would have better performance and why? I try to search on the internet but I didn't find any performance comparison.
51 replies
Problems changing the value of a reactive signal returned from a function
I think I understood, with third-party component you mean like a library to add to my project, and that this library has a component and that if I pass the board as a parameter, if it modifies the value of the board from the other component, it would be modifying the state of my current component? Is that?
51 replies