all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Cohen <acohen@ust.hk>
Cc: emacs-devel@gnu.org
Subject: Re: sorting in C
Date: Fri, 04 Mar 2022 09:05:11 +0200	[thread overview]
Message-ID: <83mti6i4ew.fsf@gnu.org> (raw)
In-Reply-To: <8735jy7exe.fsf@ust.hk> (message from Andrew Cohen on Fri, 04 Mar 2022 08:13:33 +0800)

> From: Andrew Cohen <acohen@ust.hk>
> Date: Fri, 04 Mar 2022 08:13:33 +0800
> 
> |                                     | oldlist | oldvec |  tim |       |
> |-------------------------------------+---------+--------+------+------|
> | (make-random-list 10000)            |    2842 |   2146 | 2233 |  27% |
> | (nreverse (make-sorted-list 10000)) |    1431 |   1004 |  174 | 722% |
> | (make-sorted-list 10000)            |    1333 |    924 |  170 | 684% |
> | (make-swapped-list 10000 3)         |    1512 |   1055 |  179 | 745% |
> | (make-plus-list 10000)              |    1346 |    915 |  174 | 674% |
> | (make-onepercent-list 10000)        |    1792 |   1308 |  274 | 554% |
> | (make-constant-list 10000)          |    1328 |    917 |  169 | 686% |
> | (make-evil-list 10000)              |    1398 |    969 |  609 | 130% |
> | (make-block-list 10000 100)         |    2244 |   1651 | 1304 |  72% |
> | (make-block-list 10000 10)          |    2641 |   1990 | 2034 |  30% |
> 
> As you can see the worst case is purely random for which the new
> algorithm is still more than 25% faster than the current one (albeit 4%
> slower than for vectors in this case), and short blocks is a close
> second. Everything else is clearly much faster, with almost everything
> else being factors of 6 to 8 times faster.

Yes, this looks very promising, thanks.

> I'll post again in awhile with final questions and some suggestions for
> pushing it to git. Please let me know if I should post the code here
> (its about 1K lines including lots of comments.)

I think it is best to send your changes as "git format-patch" in a
message submitted to bug-gnu-emacs@gnu.org, which will then create an
issue on our issue tracker.  That will ensure this is not forgotten by
some chance.

Then we will wait for the completion of your legal paperwork.

Thanks.



  reply	other threads:[~2022-03-04  7:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22  2:52 sorting in C Andrew Cohen
2022-02-22 12:30 ` Eli Zaretskii
2022-02-22 12:54   ` Andrew Cohen
2022-02-22 13:11     ` Eli Zaretskii
2022-02-23  4:14   ` Andrew Cohen
2022-02-23 12:34     ` Eli Zaretskii
2022-02-23 12:53       ` Andrew Cohen
2022-02-23 13:14         ` Eli Zaretskii
2022-02-23 13:52           ` Andrew Cohen
2022-02-23 14:06           ` Andrew Cohen
2022-02-23 14:18             ` Eli Zaretskii
2022-02-26 23:54               ` Andrew Cohen
2022-02-27  2:27                 ` Andrew Cohen
2022-02-27  7:28                   ` Eli Zaretskii
2022-02-27  9:11                     ` Andrew Cohen
2022-02-27  9:29                       ` Eli Zaretskii
2022-02-27 10:42                         ` Andrew Cohen
2022-03-04  0:13                           ` Andrew Cohen
2022-03-04  7:05                             ` Eli Zaretskii [this message]
2022-02-23 13:19         ` Yuri Khan
2022-02-23 14:12           ` Andrew Cohen
2022-02-22 13:12 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mti6i4ew.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=acohen@ust.hk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.