all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Vector and List Performance
@ 2009-06-08 17:27 Nordlöw
  2009-06-08 19:57 ` Tassilo Horn
  2009-06-09  9:30 ` Pascal J. Bourguignon
  0 siblings, 2 replies; 8+ messages in thread
From: Nordlöw @ 2009-06-08 17:27 UTC (permalink / raw)
  To: help-gnu-emacs

I'm trying to figure the performance different between lists and
vectors. Here is my mockup:

  (defun bench (&rest forms)
    "Convenience wrapper for benchmark-run-compiled."
    (/ (nth 0 (benchmark-run 1024 forms)) 1024))

(let ((length 1000000))
  (cons
   (bench (aref (make-vector length 0) (/ length 2)))
   (bench (nth (/ length 2) (make-list length 0)))
   ))

Strangely I can't seem to find any significant different in
performance when accessing the middle element in a long vector and
long list. Shouldn't the random access performance be the big
difference between vectors and lists? What have I missed?

Thanks in advance,
Per Nordlöw


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-06-10  8:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-08 17:27 Vector and List Performance Nordlöw
2009-06-08 19:57 ` Tassilo Horn
2009-06-09  9:30 ` Pascal J. Bourguignon
2009-06-09 11:30   ` Nordlöw
2009-06-09 12:51     ` Pascal J. Bourguignon
2009-06-09 18:13       ` Nordlöw
2009-06-10  8:24         ` Pascal J. Bourguignon
     [not found]         ` <7c63f45we1.fsf@pbourguignon.informatimago.com>
2009-06-10  8:36           ` Pascal J. Bourguignon

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.