SleepPolar
SleepPolar
Explore posts from servers
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
With that video it became clearer to me.
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems 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
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
That's what I assumed, thanks for confirming it. And About Data-Oriented Design. It's something like this?
const person = {
name: 'Mary',
age: 25
};

function printInformation(person) {
console.log(`Name: ${person.name}, Age: ${person.age}`);
}

printInformation(person);
const person = {
name: 'Mary',
age: 25
};

function printInformation(person) {
console.log(`Name: ${person.name}, Age: ${person.age}`);
}

printInformation(person);
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
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
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
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
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
Thanks for the images, now I understand it better.
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
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
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
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
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
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
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
It's good to keep that in mind
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
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
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
I am new at this. What does a third-party component mean?
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
That's true 😅
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
I don't understand it, can you give me a small example?
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
this is how it looks 😁
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
No description
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
I had tried that, but it doesn't seem to work because it keeps tracking it. Maybe you can't untrack a function 🤔
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
I don't get it
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
this?
51 replies
SSolidJS
Created by SleepPolar on 5/21/2024 in #support
Problems changing the value of a reactive signal returned from a function
But I realized something. I can return the board without it being a Signal, and the returned board I convert to a Signal, and there is no need to untrack.
51 replies