defun function call count

27 views
Skip to first unread message

Tatsuya Tsuda

unread,
Apr 27, 2017, 3:03:42 PM4/27/17
to Shen
I have counted all of the defun function call of Shen-C from program start to test suite end.

Below is the result.

This was done by natively injecting counting codes at the beginning of the defun body.
You can use this data and measure the function call time to improve your Shen implementation.


Tatsuya Tsuda

deech

unread,
Apr 27, 2017, 3:23:29 PM4/27/17
to Shen
Mother of god! I replaced `element?` with a native implementation and the elisp test suite went from 45 -> 34 seconds! Thank you!

Neal Alexander

unread,
Apr 27, 2017, 3:34:55 PM4/27/17
to Shen
Looks to be mostly shen Prolog stuff.

I suspect my port would benefit if Shen had a separate mechanism for handling very large vectors manually via mmap/mremap.

Bruno Deferrari

unread,
Apr 27, 2017, 3:36:19 PM4/27/17
to qil...@googlegroups.com
On Thu, Apr 27, 2017 at 4:23 PM, deech <aditya...@gmail.com> wrote:
Mother of god! I replaced `element?` with a native implementation and the elisp test suite went from 45 -> 34 seconds! Thank you!


Be careful, if the underlying's platform equality operator does not behave in the same way as Shen's `=` function you may be changing behavior in some (rare?) cases. It is easy to solve anyway, all you have to do is to take a fast path and use the native version when possible, and fall back to Shen's `element?` implementation otherwise.

 

On Thursday, April 27, 2017 at 2:03:42 PM UTC-5, Tatsuya Tsuda wrote:
I have counted all of the defun function call of Shen-C from program start to test suite end.

Below is the result.

This was done by natively injecting counting codes at the beginning of the defun body.
You can use this data and measure the function call time to improve your Shen implementation.


Tatsuya Tsuda

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+unsubscribe@googlegroups.com.
To post to this group, send email to qil...@googlegroups.com.
Visit this group at https://groups.google.com/group/qilang.
For more options, visit https://groups.google.com/d/optout.



--
BD

deech

unread,
Apr 27, 2017, 3:53:03 PM4/27/17
to Shen
Accounted for that. Still getting the perf. increase!


On Thursday, April 27, 2017 at 2:36:19 PM UTC-5, Bruno Deferrari wrote:
On Thu, Apr 27, 2017 at 4:23 PM, deech <aditya...@gmail.com> wrote:
Mother of god! I replaced `element?` with a native implementation and the elisp test suite went from 45 -> 34 seconds! Thank you!


Be careful, if the underlying's platform equality operator does not behave in the same way as Shen's `=` function you may be changing behavior in some (rare?) cases. It is easy to solve anyway, all you have to do is to take a fast path and use the native version when possible, and fall back to Shen's `element?` implementation otherwise.

 

On Thursday, April 27, 2017 at 2:03:42 PM UTC-5, Tatsuya Tsuda wrote:
I have counted all of the defun function call of Shen-C from program start to test suite end.

Below is the result.

This was done by natively injecting counting codes at the beginning of the defun body.
You can use this data and measure the function call time to improve your Shen implementation.


Tatsuya Tsuda

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.

To post to this group, send email to qil...@googlegroups.com.
Visit this group at https://groups.google.com/group/qilang.
For more options, visit https://groups.google.com/d/optout.



--
BD
Reply all
Reply to author
Forward
0 new messages