Search found 66 matches
- Thu May 30, 2019 7:15 pm
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
I understand what your saying. But there's nothing unusual or difficult to understand in the code I submitted, as far as I know. I'm dumbfounded by the amount of discussion and scrutiny that tiny class has been through. The whole point of having a library is to contain a set of useful functions that ...
- Wed May 29, 2019 6:09 pm
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
I'd take the first rule of optimization here: Any optimization that complicates the code is not worth taking unless it has a definitive and measurable impact on overall performance. Exactly. Which is why the only word that should carry any weight is a profile of all versions in question. Which is ...
- Tue May 28, 2019 11:47 pm
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
I don't think you caught my drift: I'm not talking about the internal workings of the class, I'm thinking about all the neat things a coder might want to use your class for: For example, I might want to spawn sparks off of all fireballs. Or, I might want to add a health bar to all bosses, or all ...
- Thu May 23, 2019 9:33 pm
- Forum: Scripting
- Topic: Will the new dyn. lights struct ever be exposed to ZScript?
- Replies: 10
- Views: 689
Re: Will the new dyn. lights struct ever be exposed to ZScri
So... it seems this is going to break an extremely important feature of one of my mods. I'm happy to do it in a different way if necessary, but I really need a way to access dynlight-affected lightlevel. I hope we can get something canonical for that. 8-) Wow, that's some fancy script you've got ...
- Mon May 20, 2019 10:08 pm
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
Heh, would you like fries with that?Kinsie wrote:ship the source port, friend
Seriously, *everything* I am doing is leading up to me being able to get back to my passions, including my port. I'm on it.
- Thu May 16, 2019 8:24 pm
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
Im lost point of what you try to achieve after second page of discussion, soo....what you try to achieve? Are actions with arrays really slow? You definitely dont want increase array efficiency just to increase array efficiency. Also said graf in the first post "if actions with array causes ...
- Thu May 16, 2019 4:30 am
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
release your source port kb1 Hey, Kinsie - I could very well be a happy man if I knew your motivations behind that command... :D It's kinda funny: I've been asked to release my port by a lot of people, without any of them having a clue about exactly what I'd be releasing. Not sure what everyone ...
- Thu May 16, 2019 1:15 am
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
@kb1 I think it's safe to say that dynamic arrays in GZDoom work differently than how you're used to them. The fewer the iterations the better. That's why I go for sizing it down and just iterating through the whole thing. However, I do thank you for giving me the code for reorganizing the data ...
- Tue May 14, 2019 11:30 pm
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
If you need the SlotCount variable, you are doing something wrong. In this case Size() should be the value SlotCount is, and if you have to append anything to the array, use the Push function, if you remove entries that reduce the size, call Resize or Pop. Arrays are designed around such a workflow ...
- Fri May 10, 2019 6:43 pm
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
If you need the SlotCount variable, you are doing something wrong. In this case Size() should be the value SlotCount is, and if you have to append anything to the array, use the Push function, if you remove entries that reduce the size, call Resize or Pop. Arrays are designed around such a workflow ...
- Fri May 10, 2019 12:40 am
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
The Size() function doesn't return size of allocated space but size of USED space. No, using Size() as the delimiter is not going for worst performance, it is what should be used to traverse all parts of the array that MAY be in use. With garbage collected objects that can obviously be a bit tricky ...
- Wed May 08, 2019 7:06 pm
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
Don't get the wrong idea. I'm still using your code, just using the Size() function instead, along with the Resize() function because, indeed, that's how dynamic arrays work in ZScript. I guess you didn't read Graf's response that really explains how dynamic arrays work...meaning that the resizing ...
- Wed May 08, 2019 3:45 am
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
Because I plan on making the array shrink if it's under 1/4 the size (except for a minimum of 256). At this point it's just micro-optimizations that aren't going to do anything better. If (Actors.SlotCount >=256) Actors.Resize(SlotCount + 128); My guess is that ZScript does not reallocate the array ...
- Tue May 07, 2019 9:12 pm
- Forum: Scripting
- Topic: Dynamic Array Efficiency?
- Replies: 60
- Views: 4638
Re: Dynamic Array Efficiency?
SlotCount is not going to be kept. I'm just going to use Actor.Size(). It's up to you. The concern is the behind-the-scenes work that occurs when testing the element for NULL. The thread I posted earlier provides some more information. But, we're talking about a few hundred elements being tested ...
- Tue May 07, 2019 8:05 pm
- Forum: Off-Topic
- Topic: Anyone else always correct false info on the internet/FB?
- Replies: 21
- Views: 1808
Re: Anyone else always correct false info on the internet/FB
That can be resolved with communication. There's nothing wrong with asking someone what their intent is. Usually if someone is truly innocent, they will be embarrassed that they were misunderstood, and they will go out of their way to try to mend bridges. That's what being civil and respectable is ...