FYI, back to where the latest profiler work started (after nsec clock)

The goal: compare performance "map(in, 'v:val')" vs "map(in, Map1)". Map1 is
        def Map1(_, val: number): number
            return val
        enddef
Turns out for processing a list with 3 items, 1.049 usec vs 1.590 usec;
at least that's the current results. (And not 1.166 vs 103)

Current vim:
   1x33   1x65   1x99   2x33   2x65   2x99   3x33   3x65   3x99 : nInputXnLoop (cells: usec/op)   0.608  0.625  0.641  0.999  0.957  0.954  1.237  1.179  1.166 : map(in, 'v:val')   ###-2   0.068  0.072  0.071  0.071  0.068  0.069  0.070  0.070  0.070 : result = []   ###-4   0.144  0.151  0.146  0.171  0.166  0.164  0.194  0.190  0.189 : in = input->copy()   ###-5   2.784  6.023 10.140 27.808 36.471 45.324 77.819     92    103 : map(in, Map1)   ###-6

Upgraded function profiling patch
  0.599  0.574  0.568  0.902  0.795  0.807  1.121  1.066  1.049 : map(in, 'v:val')   ###-2   0.071  0.072  0.071  0.072  0.069  0.071  0.071  0.070  0.070 : result = []   ###-4   0.152  0.151  0.149  0.179  0.175  0.173  0.200  0.200  0.205 : in = input->copy()   ###-5   0.807  0.771  0.723  1.179  1.182  1.165  1.663  1.598  1.590 : map(in, Map1)   ###-6

-ernie

On 23/03/23 7:31 PM, Ernie Rael wrote:
Opened draft PR: https://github.com/vim/vim/pull/12192
Initial results are promising, one measure is how few loops are
required for the results to stabilize.
And the results show *faster times* when user defined functions
are involved. It's interesting how good that feels, even though
it doesn't mean anything is actually running faster in production.

On 23/03/23 8:19 AM, Bram Moolenaar wrote:
Ernie Rael wrote:

You might want to store the hash number with the function to avoid the
overhead of computing it.

This still needs to be done. To make sure I understand,
this is saving `hash_hash(name)` in ufunc_T and has_profiling has an
additional argument which is the hash. And if this argument is zero
then the hash would be computed in has_profiling.

   The overhead of looking up the key in the
table can't be avoided.  Also, when more function names are being cached
updating the hash table can also take a noticable amount of time.
Yes, but it also would usually indicate that the table has been very useful.

I don't know most use cases; does the number of things being profiled
change dynamically or very often?

-ernie
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/911e2e0b-ab7b-8d34-e205-6c6cbeea1cc8%40raelity.com <https://groups.google.com/d/msgid/vim_dev/911e2e0b-ab7b-8d34-e205-6c6cbeea1cc8%40raelity.com?utm_medium=email&utm_source=footer>.

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/f61e3ca8-180e-85c7-b050-24a7f7203b6d%40raelity.com.

Raspunde prin e-mail lui