|
| 13 Aug 2012 02:58 AM |
i have been encoding a huge script and the load string take about 30 sec, how can i speed it up?
>Im not going to post the encode script because i will need 2 or more post to put it and secondly its private
perhaps something with the decode part that i made?
String = {code here}
local text = {}
for i=1,#String do table.insert(text,string.char(String[i])) end
loadstring(table.concat(text))() |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2012 03:12 AM |
| I dont think anyone can help with such little information |
|
|
| Report Abuse |
|
|
| |
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 13 Aug 2012 03:53 AM |
You call loading your string into a table coding/decoding? Thats a good joke xD.
Loadstring is pretty slow, so get used to it. Or: make your script shorter by using tables ;) |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2012 03:58 AM |
| if i put my script inside Microsoft Words, it will have 32 pages ;~; |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 13 Aug 2012 04:01 AM |
O.e can you please explain what sort of script that even is!?
Maybe you can try splitting it up in parts. Like 32 parts (1 page for every part) and you run 32 scripts that loads a part. Maybe thats faster?
You might try to see what takes the longest: the loadstring, or the table.concat stuff.
Try this and remember the values;
String = {code here}
local text = {}
local timerstart = tick()
for i=1,#String do table.insert(text,string.char(String[i])) end
print(tick() - timerstart, "this is for creating the table") local timerstart2 = tick()
loadstring(table.concat(text)) --> No running, only load it. print(tick() - timerstart2, "this is for da loading") |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2012 04:03 AM |
| its a Script Builder Script, and im gona try out what you said and print the results. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 13 Aug 2012 04:06 AM |
| Do that. I really think you better do not first create a huge table, then concentate everything. I think thats a huge speed up if you instantly load the string. |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2012 04:13 AM |
btw, i cant split up the script.
0.041070938110352 this is for creating the table 0.0066087245941162 this is for da loading |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 13 Aug 2012 05:21 AM |
| You said it was 30 seconds. |
|
|
| Report Abuse |
|
|