Skip to main content

Hi UnifAce
which solution do have a better perfomance?
$1 = "%%v_VAR1%%v_VAR2" 
$1 = $concat(v_VAR1,v_VAR2)

Im look for the last bits and bytes to get more performance 🙂

Ingo

PS: Does UnifAce have "rvalue references" like C++ so a return variable would not be move but only a pointer is set grins 


Hi UnifAce
which solution do have a better perfomance?
$1 = "%%v_VAR1%%v_VAR2" 
$1 = $concat(v_VAR1,v_VAR2)

Im look for the last bits and bytes to get more performance 🙂

Ingo

PS: Does UnifAce have "rvalue references" like C++ so a return variable would not be move but only a pointer is set grins 


Apparently someone else already did the math:

Performance of string manipulation - part two

Daniel 


Hi UnifAce
which solution do have a better perfomance?
$1 = "%%v_VAR1%%v_VAR2" 
$1 = $concat(v_VAR1,v_VAR2)

Im look for the last bits and bytes to get more performance 🙂

Ingo

PS: Does UnifAce have "rvalue references" like C++ so a return variable would not be move but only a pointer is set grins 


ThanX


Hi UnifAce
which solution do have a better perfomance?
$1 = "%%v_VAR1%%v_VAR2" 
$1 = $concat(v_VAR1,v_VAR2)

Im look for the last bits and bytes to get more performance 🙂

Ingo

PS: Does UnifAce have "rvalue references" like C++ so a return variable would not be move but only a pointer is set grins 


Being a tad lazy are we Ingo?  😉

<code>

variables
string v_var1, v_var2
numeric loop1
endvariables

v_var1 = "Hocus"
v_var2 = " Pocus"

putmess $datim
for loop1 = 1 to 10000000
$1 = "%%v_var1%%v_var2"
endfor
putmess $datim
putmess "======================"
putmess $datim
for loop1 = 1 to 10000000
$1 = $concat(v_var1,v_var2)
endfor
putmess $datim

</code>


Being a tad lazy are we Ingo?  😉

<code>

variables
string v_var1, v_var2
numeric loop1
endvariables

v_var1 = "Hocus"
v_var2 = " Pocus"

putmess $datim
for loop1 = 1 to 10000000
$1 = "%%v_var1%%v_var2"
endfor
putmess $datim
putmess "======================"
putmess $datim
for loop1 = 1 to 10000000
$1 = $concat(v_var1,v_var2)
endfor
putmess $datim

</code>

Is it  our task to find the statement with the best performance under all cirumstances 🙂
<dreaming>
UnifAce should write down for every statement what itdoes do on runtime and what's to cost to do so.
</dreaming>

Ingo


Apparently someone else already did the math:

Performance of string manipulation - part two

Daniel 

Hi Daniel,

as of today a quick test using Knut code snippet reports a different scenario compared to the one described from Rik Lewis in 2012; while Rik reported similar performances in these two cases, $concat() for me is 3.5 faster that old style concatenation:
- old style: 3'24"95
- $concat: 39"42

It is possible the new compiler used since U9.7 has an impact here. My environment:
- Uniface U9.7.05.023
- Windows 10 1903 (VMware virtual machine in a Linux host)

Gianni


Being a tad lazy are we Ingo?  😉

<code>

variables
string v_var1, v_var2
numeric loop1
endvariables

v_var1 = "Hocus"
v_var2 = " Pocus"

putmess $datim
for loop1 = 1 to 10000000
$1 = "%%v_var1%%v_var2"
endfor
putmess $datim
putmess "======================"
putmess $datim
for loop1 = 1 to 10000000
$1 = $concat(v_var1,v_var2)
endfor
putmess $datim

</code>

@Ingo

<dreaming><followUp>

I've started to implement what you are asking for (cost of each instruction/function in all possible usages...) in 1992 at Uniface5 times, when Proc Language was (by far) simpler than today. I easily reached hundreds of cases, than one thousand and over...finally we've decided to give up because a rough extimation computed about 11.000 cases to complete the project. Too many!

</followUp></dreaming>

Gianni