benchmark request I2R (I)*1.0 and function call.

Vexorian

Why no custom sig?
Reaction score
187
Err, I need a benchmark that compares I2R(integervalue) , integervalue * 1.0 and a single function call in what regards to the time they take. I cannot do proper benchmarks since grimoire has no Linux support.
 
Reaction score
333
Is that I2R and [i*1.0 and a function call]?

Using the StopWatch natives, I tested 1000 calls to I2R against a 1000s call to:
JASS:
function X takes integer i returns real
    return i*1.00
endfunction

And found:
Code:
[B]I2R:[/B]
 2.634, 4.774, 2.484, 2.468, 2.739, 2.540, 2.557
[B]X:[/B]
 4.090, 3.534, 3.794, 3.576, 3.575, 3.870, 3.664

Which seems to show that I2R is faster.
 

emjlr3

Change can be a good thing
Reaction score
395
he wanted I2R i believe

if i knew how stopwatch worked id do it
 

Vexorian

Why no custom sig?
Reaction score
187
No, actually.

I wanted three benchmarks.

One should test the time a function call that does nothing takes.

The other I2R(integervalue). And finally one should do (integervalue*1.0) and should not have any function call involved.

I guess something like this:

JASS:
//control:
set i=CONSTANT
loop
      exitwhen i==0
      set u=GetRandomInt(0,1000000000)
      set i=i-1
endloop



JASS:
//test 1
set i=CONSTANT
loop
      exitwhen i==0
      cal DoNothing()
      set u=GetRandomInt(0,1000000000)
      set i=i-1
endloop


JASS:
//test2
set i=CONSTANT
loop
      exitwhen i==0
      set r=I2R(GetRandomInt(0,1000000000))
      set i=i-1
endloop


JASS:
//test3
set i=CONSTANT
loop
      exitwhen i==0
      set r=GetRandomInt(0,1000000000)*1.0 //r is a real
      set i=i-1
endloop
 
Reaction score
333
Code:
[B]Control:[/B]
 2.728, 3.193, 3.025, 3.310, 3.189, 3.047, 3.340, 3.045, 3.117, 3.133
[B]DoNothing():[/B]
 3.348, 3.677, 3.487, 4.424, 3.638, 3.554, 5.100, 4.996, 3.561, 3.562
[B]I2R:[/B]
 4.486, 3.859, 4.093, 3.958, 6.023, 3.698, 3.859, 4.046, 3.970, 4.919
[B]i*1.0[/B]
 3.696, 3.638, 3.724, 3.621, 5.883, 5.287, 3.489, 3.588, 3.588, 3.453

JASS:
set t0 = StopWatchMark(sw)
loop
    exitwhen i == 0
    //call DoNothing() // function call
    //set x = GetRandomInt(0,1000000000) // control + function call
    //set r = I2R(GetRandomInt(0,1000000000)) // I2R
    //set r = GetRandomInt(0,1000000000)*1.0 // i*1.0
    set i = i-1
endloop
set t1 = StopWatchMark(sw)


i begins at 1000.
 

Vexorian

Why no custom sig?
Reaction score
187
one more, is it possible you did the DoNothing one on a map with 1000 functions that instead of calling DoNothing would call another empty function that's declared in the map?

Edit: Actually, make a function like this:

JASS:
function TR takes real level returns real
    return level
endfunction


And use it instead of I2R.

Right now it looks like inlinig functions with real arguments is a bad idea.
 
Reaction score
333
one more, is it possible you did the DoNothing one on a map with 1000 functions that instead of calling DoNothing would call another empty function that's declared in the map?

Edit: Actually, make a function like this:

JASS:

function TR takes real level returns real
    return level
endfunction


And use it instead of I2R.

Right now it looks like inlinig functions with real arguments is a bad idea.

As:
JASS:
set x = GetRandomInt(0,1000000000)
set r = TR(42.00)

Or:
JASS:
set r = TR(GetRandomReal(0,1000000000))

Or omit the call to GetRandomInt(0,1000000000) from the benchmark altogether?
 
Reaction score
333
Code:
[B]Control:[/B]
 3.776, 3.226, 4.881, 4.857, 2.886, 3.686, 2.948, 2.926, 3.251, 4.578, 3.166, 3.063
[B]Function Call:[/B]
 3.481, 3.579, 3.564, 3.465, 4.431, 4.666, 3.462, 3.613, 3.404, 5.441, 3.465, 5.629,
[B]TR:[/B]
 5.471, 5.969, 7.136, 7.030, 7.091, 5.075, 7.281, 5.786, 6.395, 5.077, 8.049, 6.170
[B]i*1.0:[/B]
 3.943, 5.053, 5.440, 5.853, 4.562, 4.627, 3.788, 4.852, 4.669, 4.483, 5.394, 4.147
 

Vexorian

Why no custom sig?
Reaction score
187
Well, actually TR replaced function call in the final tests table, anyways, this should be enough, looks like i*1.0 is faster than the function call+argument, this makes things amazingly easy for me, won't need to parse a lot of things to make inline work well.
 

emjlr3

Change can be a good thing
Reaction score
395
can you explain exactly how this benchmarking works, I have never been able to figure it out from the readme

or post your code or something
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top