Difference between revisions of "Talk:LSL Hacks"
Jump to navigation
Jump to search
(New page: A friend said that the same (List != []) trick can be used for string. Can someone verify that this memory hack works for strings? --~~~~) |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
A friend said that the same (List != []) trick can be used for string. Can someone verify that this memory hack works for strings? --[[User:Nexii Malthus|Nexii Malthus]] 13:43, 13 August 2008 (PDT) | A friend said that the same (List != []) New + [] of addition elements trick can be used for string. Can someone verify that this memory hack works for strings? --[[User:Nexii Malthus|Nexii Malthus]] 13:43, 13 August 2008 (PDT) | ||
:I have added the <code>(List = []) + List</code> hack to the list, I don't recall why I didn't add it last time. Could you give a (better) example of what you mean, it's not immediately apparent. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 14:24, 13 August 2008 (PDT) | |||
Some people have claimed the (list=[]) is no longer necessary to speed up code. Is tris true? what about for strings? | |||
[[User:Contagious Republic|Contagious Republic]] 12:41, 31 March 2011 (PDT) | |||
:Short answer, it is try but only for Mono. | |||
:I don't recall it making scripts run faster, just be able to use more of their memory before stack-heaping. | |||
:LSO scripts each have 16kb of memory that is statically allocated (when they dynamically allocated memory it is allocated inside that 16kb of memory); when working with large strings or lists, memory fragmentation and temporary values could render half the remaining unallocated memory unusable. This hack made it possible to have the original removed after it was no longer needed, freeing it's memory (LSO is pass-by-value for everything). The Mono VM is smarter, it uses pass-by-reference. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 21:18, 1 April 2011 (PDT) |
Latest revision as of 20:18, 1 April 2011
A friend said that the same (List != []) New + [] of addition elements trick can be used for string. Can someone verify that this memory hack works for strings? --Nexii Malthus 13:43, 13 August 2008 (PDT)
- I have added the
(List = []) + List
hack to the list, I don't recall why I didn't add it last time. Could you give a (better) example of what you mean, it's not immediately apparent. -- Strife (talk|contribs) 14:24, 13 August 2008 (PDT)
Some people have claimed the (list=[]) is no longer necessary to speed up code. Is tris true? what about for strings?
Contagious Republic 12:41, 31 March 2011 (PDT)
- Short answer, it is try but only for Mono.
- I don't recall it making scripts run faster, just be able to use more of their memory before stack-heaping.
- LSO scripts each have 16kb of memory that is statically allocated (when they dynamically allocated memory it is allocated inside that 16kb of memory); when working with large strings or lists, memory fragmentation and temporary values could render half the remaining unallocated memory unusable. This hack made it possible to have the original removed after it was no longer needed, freeing it's memory (LSO is pass-by-value for everything). The Mono VM is smarter, it uses pass-by-reference. -- Strife (talk|contribs) 21:18, 1 April 2011 (PDT)