Embeddable Common-Lisp main repository.
Find a file
Daniel Kochmański 6930c315a6 Merge branch 'fix/stable-inline-sort-on-vectors' into 'develop'
New inline stable sort for vectors

This PR should improve on the current stable sorting of vectors, fixing issues such as #217 (bug) and #101 (performance).

Full disclosure: The merge sort algorithm was completely stolen from sbcl.

I'm sure the new version can be optimized, for example by inlining `stable-sort-merge-vectors`, and by treating simple-arrays differently.

But for now, it already has slightly better performance on the sequences that I tested with, for example running:

```common-lisp
(time (dotimes (x 50000)
	(defparameter *my-arr* 
		(make-array 9 :initial-contents
		(list
		  (cons 3 'a)
		  (cons 2 'b)
		  (cons 2 'c)
		  (cons 2 'd)
		  (cons 3 'e)
		  (cons 2 'f)
		  (cons 2 'g)
		  (cons 2 'h)
		  (cons 1 'i))))

	(stable-sort *my-arr* #'< :key #'car)))
```

gave me 0.34 sec in the old version, and 0.28sec in the new one (even with the overhead of the make-array call, which is the same for both). But most importantly, the new version leaves the array sorted, which fixes bug #217:

```common-lisp
> *my-arr*
#A(T (9) ((1 . I) (2 . B) (2 . C) (2 . D) (2 . F) (2 . G) (2 . H) (3 . A) (3 . E)))
```

while in the old-version:
```common-lisp
> *my-arr*
#A(T (9) ((3 . A) (2 . B) (2 . C) (2 . D) (3 . E) (2 . F) (2 . G) (2 . H) (1 . I)))
```

The example in #217 also works now, of course:
```common-lisp
> (let ((a (copy-seq "BCA")))
        (stable-sort a #'char<)
        a)

"ABC"
```

See merge request !28
2016-07-28 16:13:23 +00:00
contrib do not warn about the PROFILE function, because this is also used in UNPROFILE 2016-07-20 11:54:06 +01:00
doc doc: fix handler_case example 2016-05-28 20:30:39 +02:00
examples android/example: add .gitignore 2015-10-28 19:59:24 +01:00
msvc Fixed VS2010/2015 build. 2016-07-21 04:45:28 -04:00
src implement new inline stable sort for vectors, fixing avoiding the previous coercion to list and actually do it inline 2016-07-26 23:52:11 +01:00
.gitignore indent: indent files according to GNU standard 2016-05-05 13:40:27 +02:00
CHANGELOG Merge branch 'develop' of gitlab.com:embeddable-common-lisp/ecl into develop 2016-06-11 16:26:24 +02:00
configure Preserve quoting when passing the arguments to the build directory 2008-08-27 09:50:44 +02:00
INSTALL INSTALL: add darwin notes 2016-05-24 21:15:41 +02:00
LGPL Initial revision 2001-06-26 17:14:44 +00:00
LICENSE loop: rename symbolics LOOP loop2.lsp to loop.lsp 2016-03-11 16:06:45 +01:00
Makefile.in makefile.in: remove obsolete rpm targets 2016-03-01 11:17:46 +01:00
README.md update readme (typos) 2015-08-31 08:22:52 +00:00

ECL stands for Embeddable Common-Lisp. The ECL project aims to produce an implementation of the Common-Lisp language which complies to the ANSI X3J13 definition of the language.

The term embeddable refers to the fact that ECL includes a Lisp to C compiler, which produces libraries (static or dynamic) that can be called from C programs. Furthermore, ECL can produce standalone executables from Lisp code and can itself be linked to your programs as a shared library. It also features an interpreter for situations when a C compiler isn't available.

ECL supports the operating systems Linux, FreeBSD, NetBSD, DragonFly BSD, OpenBSD, Solaris (at least v. 9), Microsoft Windows (MSVC, MinGW and Cygwin) and OSX, running on top of the Intel, Sparc, Alpha, ARM and PowerPC processors. Porting to other architectures should be rather easy.