[armedbear-devel] Array Cleanup Example

logicmoo at gmail.com logicmoo at gmail.com
Wed Nov 11 14:46:07 UTC 2009


>> CONS:
>> On a 32bit machine the new represention takes the same ram
>> 64 bit machine takes twice the ram after the refactor.

>Are our Fixnums dependent on the machine architecture? Why, how?

  int[] array  on both archs are 32bits each
  Fixnum[]  is a java.lang.Object[] which are 32bits on JVM32 and 64bits on JVM64.
   -  So that is where the extra memory comes in

 Now that is evaluating uint16s in BasicVector_UnsignedByte16
 when it comes to  uint32s in BasicVector_UnsignedByte32  ..
   we store now into long[] which means this:
   On  JVM32 we'd use up only 1/2 the memory than currently to store the same data if boxed
      (if all the values were the simular numbers,   If every value stored in the array is differnt.. bets are off since
     we allocate their boxes on the java heap)



>Is there any noticeable performance difference?


  Its really hard to say ..



INT32

;; -*- lisp -*-  Armed Bear Common Lisp 0.18.0-dev
;;
;; Implementation *features*:
;; (:X86-64 :JAVA-1.6 :ARMEDBEAR :ABCL :COMMON-LISP :ANSI-CL :WINDOWS :CDR6)
;;
;; Function                      real     user     sys       consed
;; ----------------------------------------------------------------
;; 1D-ARRAYS 7.219 7.219 0.0 0
;; 2D-ARRAYS 20.562 20.562 0.0 0
;; 3D-ARRAYS 25.25 25.25 0.0 0
;; BITVECTORS 2.688 2.688 0.0 0
;; BENCH-STRINGS 11.468 11.468 0.0 0
;; fill-strings/adjustable 6.391 6.391 0.0 0
;; STRING-CONCAT 20.515 20.515 0.0 0

("Armed Bear Common Lisp 0.18.0-dev" ("STRING-CONCAT" 4103/200 4103/200 0 0) ("fill-strings/adjustable" 6391/1000 6391/1000 0 0) 
("BENCH-STRINGS" 2867/250 2867/250 0 0) ("BITVECTORS" 336/125 336/125 0 0) ("3D-ARRAYS" 101/4 101/4 0 0) ("2D-ARRAYS" 10281/500 
10281/500 0 0) ("1D-ARRAYS" 7219/1000 7219/1000 0 0))

FIXNUM
;; -*- lisp -*-  Armed Bear Common Lisp 0.18.0-dev
;;
;; Implementation *features*:
;; (:X86-64 :JAVA-1.6 :ARMEDBEAR :ABCL :COMMON-LISP :ANSI-CL :WINDOWS :CDR6)
;;
;; Function                      real     user     sys       consed
;; ----------------------------------------------------------------
;; 1D-ARRAYS 7.922 7.922 0.0 0
;; 2D-ARRAYS 24.031 24.031 0.0 0
;; 3D-ARRAYS 27.734 27.734 0.0 0
;; BITVECTORS 3.282 3.282 0.0 0
;; BENCH-STRINGS 13.859 13.859 0.0 0
;; fill-strings/adjustable 7.078 7.078 0.0 0
;; STRING-CONCAT 22.688 22.688 0.0 0

("Armed Bear Common Lisp 0.18.0-dev" ("STRING-CONCAT" 2836/125 2836/125 0 0) ("fill-strings/adjustable" 3539/500 3539/500 0 0) 
("BENCH-STRINGS" 13859/1000 13859/1000 0 0) ("BITVECTORS" 1641/500 1641/500 0 0) ("3D-ARRAYS" 13867/500 13867/500 0 0) ("2D-ARRAYS" 
24031/1000 24031/1000 0 0) ("1D-ARRAYS" 3961/500 3961/500 0 0))

FIXNUM
;; -*- lisp -*-  Armed Bear Common Lisp 0.18.0-dev
;;
;; Implementation *features*:
;; (:X86-64 :JAVA-1.6 :ARMEDBEAR :ABCL :COMMON-LISP :ANSI-CL :WINDOWS :CDR6)
;;
;; Function                      real     user     sys       consed
;; ----------------------------------------------------------------
;; 1D-ARRAYS 7.063 7.063 0.0 0
;; 2D-ARRAYS 21.609 21.609 0.0 0
;; 3D-ARRAYS 26.063 26.063 0.0 0
;; BITVECTORS 2.656 2.656 0.0 0
;; BENCH-STRINGS 11.625 11.625 0.0 0
;; fill-strings/adjustable 6.422 6.422 0.0 0
;; STRING-CONCAT 20.015 20.015 0.0 0

("Armed Bear Common Lisp 0.18.0-dev" ("STRING-CONCAT" 4003/200 4003/200 0 0) ("fill-strings/adjustable" 3211/500 3211/500 0 0) 
("BENCH-STRINGS" 93/8 93/8 0 0) ("BITVECTORS" 332/125 332/125 0 0) ("3D-ARRAYS" 26063/1000 26063/1000 0 0) ("2D-ARRAYS" 21609/1000 
21609/1000 0 0) ("1D-ARRAYS" 7063/1000 7063/1000 0 0))

INT32

;; -*- lisp -*-  Armed Bear Common Lisp 0.18.0-dev
;;
;; Implementation *features*:
;; (:X86-64 :JAVA-1.6 :ARMEDBEAR :ABCL :COMMON-LISP :ANSI-CL :WINDOWS :CDR6)
;;
;; Function                      real     user     sys       consed
;; ----------------------------------------------------------------
;; 1D-ARRAYS 7.375 7.375 0.0 0
;; 2D-ARRAYS 21.312 21.312 0.0 0
;; 3D-ARRAYS 26.094 26.094 0.0 0
;; BITVECTORS 2.703 2.703 0.0 0
;; BENCH-STRINGS 12.281 12.281 0.0 0
;; fill-strings/adjustable 6.266 6.266 0.0 0
;; STRING-CONCAT 19.859 19.859 0.0 0

("Armed Bear Common Lisp 0.18.0-dev" ("STRING-CONCAT" 19859/1000 19859/1000 0 0) ("fill-strings/adjustable" 3133/500 3133/500 0 0) 
("BENCH-STRINGS" 12281/1000 12281/1000 0 0) ("BITVECTORS" 2703/1000 2703/1000 0 0) ("3D-ARRAYS" 13047/500 13047/500 0 0) 
("2D-ARRAYS" 2664/125 2664/125 0 0) ("1D-ARRAYS" 59/8 59/8 0 0))

FIXNUM
;; -*- lisp -*-  Armed Bear Common Lisp 0.18.0-dev
;;
;; Implementation *features*:
;; (:X86-64 :JAVA-1.6 :ARMEDBEAR :ABCL :COMMON-LISP :ANSI-CL :WINDOWS :CDR6)
;;
;; Function                      real     user     sys       consed
;; ----------------------------------------------------------------
;; 1D-ARRAYS 7.125 7.125 0.0 0
;; 2D-ARRAYS 21.422 21.422 0.0 0
;; 3D-ARRAYS 26.187 26.187 0.0 0
;; BITVECTORS 2.703 2.703 0.0 0
;; BENCH-STRINGS 11.031 11.031 0.0 0
;; fill-strings/adjustable 6.438 6.438 0.0 0
;; STRING-CONCAT 19.594 19.594 0.0 0

("Armed Bear Common Lisp 0.18.0-dev" ("STRING-CONCAT" 9797/500 9797/500 0 0) ("fill-strings/adjustable" 3219/500 3219/500 0 0) 
("BENCH-STRINGS" 11031/1000 11031/1000 0 0) ("BITVECTORS" 2703/1000 2703/1000 0 0) ("3D-ARRAYS" 26187/1000 26187/1000 0 0) 
("2D-ARRAYS" 10711/500 10711/500 0 0) ("1D-ARRAYS" 57/8 57/8 0 0))

INT32
;; -*- lisp -*-  Armed Bear Common Lisp 0.18.0-dev
;;
;; Implementation *features*:
;; (:X86-64 :JAVA-1.6 :ARMEDBEAR :ABCL :COMMON-LISP :ANSI-CL :WINDOWS :CDR6)
;;
;; Function                      real     user     sys       consed
;; ----------------------------------------------------------------
;; 1D-ARRAYS 7.235 7.235 0.0 0
;; 2D-ARRAYS 20.875 20.875 0.0 0
;; 3D-ARRAYS 25.718 25.718 0.0 0
;; BITVECTORS 2.672 2.672 0.0 0
;; BENCH-STRINGS 12.297 12.297 0.0 0
;; fill-strings/adjustable 6.343 6.343 0.0 0
;; STRING-CONCAT 20.063 20.063 0.0 0

("Armed Bear Common Lisp 0.18.0-dev" ("STRING-CONCAT" 20063/1000 20063/1000 0 0) ("fill-strings/adjustable" 6343/1000 6343/1000 0 0) 
("BENCH-STRINGS" 12297/1000 12297/1000 0 0) ("BITVECTORS" 334/125 334/125 0 0) ("3D-ARRAYS" 12859/500 12859/500 0 0) ("2D-ARRAYS" 
167/8 167/8 0 0) ("1D-ARRAYS" 1447/200 1447/200 0 0))




_______________________________________________
armedbear-devel mailing list
armedbear-devel at common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel 





More information about the armedbear-devel mailing list