I don't understand, please explain.
In my GetTickCount test (default Lazarus proj opt) i have same time of conv3/conv4.
Free Pascal:conv1: 0.487000sconv2: 0.513000sconv3: 0.117000sconv4: 0.106000sconv5: 0.092000sMSElang:conv1: 0.157672sconv2: 0.170412sconv3: 0.0998492sconv4: 0.0773759s
Code: [Select]Free Pascal:conv1: 0.487000sconv2: 0.513000sconv3: 0.117000sconv4: 0.106000sconv5: 0.092000sMSElang:conv1: 0.157672sconv2: 0.170412sconv3: 0.0998492sconv4: 0.0773759s
Can you try to write the assembler code directly into above conv5()?
The figures are impressive. What assembly do you have for MSElang conv4?
.align 16, 0x90 .type conv4,@functionconv4: # @conv4.Lfunc_begin107: .cfi_startproc# BB#0: pushl %ebx.Ltmp430: .cfi_def_cfa_offset 8 pushl %edi.Ltmp431: .cfi_def_cfa_offset 12 pushl %esi.Ltmp432: .cfi_def_cfa_offset 16 subl $16, %esp.Ltmp433: .cfi_def_cfa_offset 32.Ltmp434: .cfi_offset %esi, -16.Ltmp435: .cfi_offset %edi, -12.Ltmp436: .cfi_offset %ebx, -8 movl 36(%esp), %esi movl 32(%esp), %ebx xorl %edi, %edi testl %esi, %esi movl $0, %eax je .LBB107_2# BB#1: movl -4(%esi), %eax.LBB107_2: # %__mla__lengthstring.exit movl %eax, 4(%esp) movl %ebx, (%esp) calll __mla__setlengthstring16 movl (%ebx), %eax testl %eax, %eax je .LBB107_4# BB#3: movl -4(%eax), %edi.LBB107_4: # %__mla__lengthstring.exit14 leal (%esi,%edi), %ecx cmpl %esi, %ecx jbe .LBB107_6 .align 16, 0x90.LBB107_5: # %.lr.ph # =>This Inner Loop Header: Depth=1 movzbl (%esi), %ecx movw %cx, (%eax) incl %esi addl $2, %eax decl %edi jne .LBB107_5.LBB107_6: # %._crit_edge addl $16, %esp popl %esi popl %edi popl %ebx retl.Lfunc_end107: .size conv4, .Lfunc_end107-conv4 .cfi_endproc
Quote from: mse on January 14, 2018, 09:23:57 amCan you try to write the assembler code directly into above conv5()?It defeats the purpose, as calling:Code: Pascal [Select][+][-] s2 := conv5(s1);causes FPC to use fpc_unicodestr_assign
QuoteQuote from: mse on January 14, 2018, 09:23:57 amCan you try to write the assembler code directly into above conv5()?It defeats the purpose, as calling:Code: Pascal [Select][+][-] s2 := conv5(s1);causes FPC to use fpc_unicodestr_assignIt should not because AFAIK "result" for strings is a hidden "var" variabe.