Skip to content

Commit

Permalink
Skip Scm_SortMethods if we have only one applicable method
Browse files Browse the repository at this point in the history
  • Loading branch information
shirok committed Apr 24, 2017
1 parent a45cb3a commit 556fee9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,5 +1,8 @@
2017-04-23 Shiro Kawai <shiro@acm.org>

* src/vmcall.c: Skip Scm_SortMethods when we have only one applicable
methods. Obvious, yeah? This makes 'ref' call 20% faster.

* src/libproc.scm (method-leaf?): Added.
* src/class.c: Changed <method> slot name: method-leaf -> leaf?
* src/libobj.scm: Dropped %method-code, for we already have
Expand Down
4 changes: 3 additions & 1 deletion src/vmcall.c
Expand Up @@ -274,7 +274,9 @@
for (int i=0;i<argc; i++, ap++) SCM_FLONUM_ENSURE_MEM(*ap);
}
#endif /*GAUCHE_FFX*/
mm = Scm_SortMethods(mm, ARGP, argc);
if (SCM_PAIRP(SCM_CDR(mm))) {
mm = Scm_SortMethods(mm, ARGP, argc);
}
if (SCM_METHOD_LEAF_P(SCM_CAR(mm))) {
nm = SCM_TRUE; /* Dummy */
} else {
Expand Down

0 comments on commit 556fee9

Please sign in to comment.