-
Posts
39,007 -
Joined
-
Last visited
-
Days Won
190
Content Type
Forums
Blogs
Knowledge Base
Everything posted by Love Zhaoying
-
Continuing work on an epic script, I've been "refactoring" some code lately and checking the results of memory usage before and after. Here, by "refactoring" I mean this: I find a few lines of code that I am using repeatedly, and turn that code into a function. To my surprise, it can use MORE script memory to do this. (I am using llGetUsedMemory() to check memory usages, as for this scenario I mostly care about "code" memory usage, not stack/heap usage.) For a simple example: If I find several places in my code that I am getting the first character from a string as a "Prefix" using llGetSubString(varname, 0,0) - then I make a function called "GetPrefix" that just returns the first character of the string. I know this is not a very good example, as it only represents a single line of code. What I found is this: If I create a function, it always uses an additional 512 bytes minimum of script memory! Depending on the number of lines in the function, it actually SAVES memory to NOT use a function and to repeat the same code in-line instead. On the other hand, depending on the number of lines of code, and how many places it is called, the 512 bytes always used by the function is made up for by having the function call. If the function has say, 10 lines of code then it would "wash" and the savings is about the same either say (again, depending on the code and number of times it is repeated). So far, doing this I have managed to save 2K total of memory in one script just by NOT writing user functions in some cases. That's not a lot, but when memory is tight it FEELS like a lot! The next part of this experiment is that I will combine two "medium-sized" functions which perform similar operations into 1 "larger" function which switches to decide exactly what operations to perform - and see if I still save that 512 bytes (from the extra function call) plus the savings from not repeating code in the two similar functions. My ultimate goal is to save about 16k by these "tweaks". It is all very counter-intuitive. Has anyone else noticed this? (Disclaimer, of course I only use Mono settings. Also, I am a professional programmer.)
-
Community Gateway Program announcement
Love Zhaoying replied to Love Zhaoying's topic in General Discussion Forum
I suppose one theory is: LL will not need to try and "fix" or improve their welcome areas, community gateway content creators will make better ones using better content. One question I had is: will community gateways get some kind of discount on tier fees, since they are ostensibly "signing up" new users? -
Community Gateway Program announcement
Love Zhaoying replied to Love Zhaoying's topic in General Discussion Forum
I'm a bit cynical at Linden's "letting" others promote SL via their own gateways. However, if it works, it works! And, motivated individuals with good intentions will probably do good things. -
What do you all think about the "Community Gateway Program" announcement?
-
I am sure the creators of "Rapelay" are devastated that SL came in as #1. The SL users in the video sure know how to party!
-
Isn't it time for LL to follow their own ToS?
Love Zhaoying replied to Drake1 Nightfire's topic in General Discussion Forum
Remembering the "Beverly Hillbillies" episode where the Clampett's thought that "topless" mean that men don't wear hats.- 35 replies
-
- 4
-
-
Bump
-
Planes=violence=adult?
-
Those naughty, randy Dragonriders!
-
SL is my favorite game! Wanna play?
-
SL isn't the same any more
Love Zhaoying replied to Phil Deakins's topic in General Discussion Forum
What does a sled-driver with a hairlip say? "Mesh! Mesh!" -
I thought of an interesting and cheesy feature: Add a "like" button directly to the "Activity streams" views for "unread posts". But then you'd not have to actually go to the thread to like a post. Just an idea..
-
Thanks for posting this, I just did it in case I ever want to go to Aditi and test upload anything!
- 5 replies
-
- 1
-
-
- preview grid
- aditi
-
(and 1 more)
Tagged with:
-
3Dconnexion SpaceNavigator issues
Love Zhaoying replied to Rivernaut Piers's topic in General Second Life Tech Discussion
Oh, so it's a 3D Mouse! -
Workflow for texturing in Blender and import to SL
Love Zhaoying replied to Anna Nova's topic in Mesh
This sounds like a big accomplishment, I hope many adopt your changes and give you feedback. While I am not a mesh creator, I follow the posts to learn and it seems like you have created a way to skip a few steps. Congratulations! -
The other thing I have done is take the mat back into inventory, wait for a while, then res it again on the floor. That appeared to work in some cases. I need to try that with my script issue also and see if that helps. This is a script I am constantly working on, in a HUD.
-
Nothing to do with anything
Love Zhaoying replied to Aislin Ceawlin's topic in General Discussion Forum
Maybe "24 hours of Happy" is a cure. http://24hoursofhappy.com -
I have seen problems lately where my script runs out of memory for some strange reason - but if I copy the code to a brand new script, it has lots of memory. For me, what I am seeing is that somehow scripts are not truly freeing all of the memory after restart or recompile, and it gets worse as time goes on. I have reproduced this twice lately. Failing that, make sure all the scripts are checked MONO not "LSO"!
-
That's where I heard that expression!
-
Is there an expression involving a bag of hammers? Not a "dumber than", I think. That's a box of rocks.
-
There is a fine line between "no value" and "priceless"!
-
I was thinking that in the context of a giveaway, asking whether someone prefers the male or female freebie is ok.
-
Ask the avatar, with a dialog box.
-
So I broke something I like and need a replacement
Love Zhaoying replied to Supersatan3's topic in General Discussion Forum
The marketplace ad says that if you already bought it you will be refunded minus the 5% Linden commission. Now, if that were TRUE (and you have faith that it's true) I would say, just buy another one and you will only end up paying the 5% commission after the "automatic refund". Not sure how that works.