|
| 01 Jan 2016 01:12 AM |
Make this more efficient
print'hi'
When I looked up "Ninjas" in Thesaurus.com, it said "Ninja's can't be found" Well played Ninjas, well played. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jan 2016 01:14 AM |
| Do it in another language. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2016 01:15 AM |
Use a C-sided function in some object.
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 01 Jan 2016 01:21 AM |
Do you not know the relationship between C and Lua? Java and Lua?
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jan 2016 01:23 AM |
| Obviously I do. "print" is calling a C-sided function, creating a C-sided method for some object is going to make things slower. |
|
|
| Report Abuse |
|
|
maxvat
|
  |
| Joined: 24 Oct 2012 |
| Total Posts: 221 |
|
| |
|
|
| 01 Jan 2016 06:38 AM |
| If I had access to the Assembly language in Lua I could make it faster. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2016 08:38 AM |
| Break your computer and go outside so you turn your life into something actually productive. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 06:31 AM |
"Obviously I do. "print" is calling a C-sided function, creating a C-sided method for some object is going to make things slower." Lua interpreters don't specifically target System.out.println() to be called when print() is executed. Nor any C prints. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 03 Jan 2016 06:35 AM |
"Lua interpreters don't specifically target System.out.println() to be called when print() is executed. Nor any C prints." They don't target "System.out.println" considering that is for Java and yes, it does use C prints obviously.
Standard Lua uses fputs but you can easily modify that to use sprintf and write to your own buffer |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 06:38 AM |
| Indeed. Please, be aware that it doesn't actually call fputs just like that into a stream. Creating a map from lua to the actual function is what I am leading to. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 03 Jan 2016 06:41 AM |
| Uh, obviously it does. Where else dose it go? In standard Lua it'll probably go straight to the STDOUT descriptor. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 07:03 AM |
ANSWER
Stop using lua and use c# and unity 3D
And type this
Debug.Log("Hi"); |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 07:05 AM |
"Stop using lua and use c# and unity 3D" Worst implementation of promotion that would cause such a commotion if I cared.
@cnt There is a middleman between the calling of fputs. When you code in Lua, you create something to directly call a function. This function serves as a catalyst and needs only an extra function to call. You, instead of using vanilla print, will execute this function without lua processing print() in the same manor, but utilizing more. See? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 03 Jan 2016 07:11 AM |
"There is a middleman between the calling of fputs. When you code in Lua, you create something to directly call a function. This function serves as a catalyst and needs only an extra function to call. You, instead of using vanilla print, will execute this function without lua processing print() in the same manor, but utilizing more. See?" The middleman is setting up the strings you pass to the print function, meaning there is no middleman.
"When you code in Lua, you create something to directly call a function..." wtf.
Whatever. When you call print, all the function does is tostring all your arguments and prints them via fputs directly. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 03 Jan 2016 07:18 AM |
| "Lua interpreters don't specifically target System.out.println() to be called when print() is executed. Nor any C prints." -cody123454321 Jan 3, 2016 |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 07:23 AM |
"When you code in Lua, you create something to directly call a function..."
I meant, When you code in the governing language with Lua, you create something to directly call a function...
So an example would how Vectors are made. The values are taken directly from Get methods.
int X = 0; int Y = 0;
void getY() { return Y }
void getX() { return X }
Lua links to these functions.
local vec3instance = lualink.getNewInstance("Vector3") print(vec3instance.getX()) --prints 0
print is like one of these functions, but it suffers a middle man, as of how it is supported, but shares in another middle man that all lua functions have to resolve from. This: "lualink.getNewInstance("Vector3")" |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 03 Jan 2016 07:25 AM |
"you create something to directly call a function" No.
|
|
|
| Report Abuse |
|
|
|
| 03 Jan 2016 07:27 AM |
Scratch directly, only attention'd the first part.
If you don't agree after that, you're just too stubborn. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 03 Jan 2016 07:33 AM |
Code in an actual environment then. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 03 Jan 2016 07:38 AM |
| You have been demoted to pleb-tier along with UnstableScript0 and others |
|
|
| Report Abuse |
|
|
| |
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 03 Jan 2016 07:46 AM |
well if it makes you feel any better, this also makes no sense: "If I had access to the Assembly language in Lua I could make it faster." |
|
|
| Report Abuse |
|
|