support sub sections of an array in .realpart
it seems, i can't reload the recompiled pylon wrapper library without restarting my lisp image
if i don't do anything to the data and acquire dark images without triggering i achieve 28fps (the slowest camera would allow 29fps)
improve speed of dark image accumulation by declaring the types
statistic profiling result for dark image accumulation

Profiler sample vector full (361 traces / 10000 samples), doubling the size
Profiler sample vector full (724 traces / 20000 samples), doubling the size
Evaluation took:
  48.969 seconds of real time
  64.221000 seconds of total run time (52.541000 user, 11.680000 system)
  [ Run times consist of 0.450 seconds GC time, and 63.771 seconds non-GC time. ]
  131.15% CPU
  137,738,868,520 processor cycles
  1 page fault
  7,148,413,136 bytes consed

Number of samples:   1000
Sample interval:     0.01 seconds
Total sampling time: 10.0 seconds
Number of cycles:    0
Sampled threads:
 #<SB-THREAD:THREAD "worker" RUNNING {1020DD3933}>

           Self        Total        Cumul
  Nr  Count     %  Count     %  Count     %    Calls  Function
------------------------------------------------------------------------
   1    762  76.2    769  76.9    762  76.2        -  "foreign function pylon_wrapper_grab_cdf"
   2    103  10.3    103  10.3    865  86.5        -  .ACCUM
   3     94   9.4    124  12.4    959  95.9        -  .REALPART
   4     30   3.0     30   3.0    989  98.9        -  SB-IMPL::ALLOCATE-VECTOR-WITH-WIDETAG
   5      2   0.2    999  99.9    991  99.1        -  (LAMBDA NIL :IN CAPTURE-DARK-IMAGES)
   6      1   0.1      1   0.1    992  99.2        -  "foreign function read"
   7      1   0.1      1   0.1    993  99.3        -  "foreign function _ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag"
   8      1   0.1      1   0.1    994  99.4        -  "foreign function _ZNK5Pylon9CInfoBase16GetPropertyValueERKN7GenICam8gcstringERS2_"
   9      1   0.1      1   0.1    995  99.5        -  "foreign function _ZNK5Pylon11CDeviceInfo15GetSerialNumberEv"
  10      0   0.0    999  99.9    995  99.5        -  SB-EXT:CALL-WITH-TIMING
  11      0   0.0    999  99.9    995  99.5        -  CAPTURE-DARK-IMAGES
  12      0   0.0    999  99.9    995  99.5        -  "Unknown component: #x1020E800D0"
  13      0   0.0    999  99.9    995  99.5        -  SB-INT:SIMPLE-EVAL-IN-LEXENV
  14      0   0.0    999  99.9    995  99.5        -  EVAL
  15      0   0.0    999  99.9    995  99.5        -  (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL)
  16      0   0.0    999  99.9    995  99.5        -  SWANK::CALL-WITH-RETRY-RESTART
  17      0   0.0    999  99.9    995  99.5        -  SWANK::CALL-WITH-BUFFER-SYNTAX
  18      0   0.0    999  99.9    995  99.5        -  SWANK:EVAL-FOR-EMACS
  19      0   0.0    999  99.9    995  99.5        -  (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD)
  20      0   0.0    999  99.9    995  99.5        -  SWANK-BACKEND::CALL-WITH-BREAK-HOOK
  21      0   0.0    999  99.9    995  99.5        -  (FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/martin/quicklisp/dists/quicklisp/software/slime-2.7/swank-sbcl.lisp")
  22      0   0.0    999  99.9    995  99.5        -  SWANK::CALL-WITH-BINDINGS
  23      0   0.0    999  99.9    995  99.5        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1210 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  24      0   0.0    999  99.9    995  99.5        -  (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  25      0   0.0    999  99.9    995  99.5        -  (FLET #:WITHOUT-INTERRUPTS-BODY-645 :IN SB-THREAD::CALL-WITH-MUTEX)
  26      0   0.0    999  99.9    995  99.5        -  SB-THREAD::CALL-WITH-MUTEX
  27      0   0.0    999  99.9    995  99.5        -  SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE
  28      0   0.0    999  99.9    995  99.5        -  "foreign function call_into_lisp"
  29      0   0.0    999  99.9    995  99.5        -  "foreign function new_thread_trampoline"
  30      0   0.0    769  76.9    995  99.5        -  PYLON::%GRAB-CDF
  31      0   0.0    769  76.9    995  99.5        -  PYLON:GRAB-CDF

most of the time is spent waiting for a new image (76%)
the rest in the calculation (.accum and .realpart)
it would be possible to get rid of consing in .realpart alltogether
profile data acquisition without image processing (step size 50)
seems like i spend a lot of time waiting for the arduino

(5 56 8 11 7 2014 4 NIL 0)
(57 58 8 11 7 2014 4 NIL 0)
Evaluation took:
  172.012 seconds of real time
  73.726000 seconds of total run time (65.714000 user, 8.012000 system)
  42.86% CPU
  483,832,320,304 processor cycles
  7,183,984 bytes consed

(9 6 9 11 7 2014 4 NIL 0)

Number of samples:   89
Sample interval:     0.01 seconds
Total sampling time: 0.89 seconds
Number of cycles:    0
Sampled threads:
 #<SB-THREAD:THREAD "worker" RUNNING {103053CCC3}>

           Self        Total        Cumul
  Nr  Count     %  Count     %  Count     %    Calls  Function
------------------------------------------------------------------------
   1     34  38.2     34  38.2     34  38.2        -  "foreign function syscall"
   2     17  19.1     17  19.1     51  57.3        -  "foreign function __nanosleep"
   3     12  13.5     12  13.5     63  70.8        -  (FLET #:CLEANUP-FUN-586 :IN SB-THREAD::CALL-WITH-SYSTEM-MUTEX)
   4      4   4.5      4   4.5     67  75.3        -  "foreign function ioctl"
   5      3   3.4      3   3.4     70  78.7        -  "foreign function write"
   6      1   1.1     35  39.3     71  79.8        -  SB-THREAD::%WAIT-FOR-MUTEX
   7      1   1.1     27  30.3     72  80.9        -  ARDUINO-SERIAL-SBCL:TALK-ARDUINO
   8      1   1.1      5   5.6     73  82.0        -  ARDUINO-SERIAL-SBCL:READ-RESPONSE
   9      1   1.1      4   4.5     74  83.1        -  READ-CHAR
  10      1   1.1      4   4.5     75  84.3        -  SB-IMPL::FLUSH-OUTPUT-BUFFER
  11      1   1.1      3   3.4     76  85.4        -  SB-IMPL::REFILL-INPUT-BUFFER
  12      1   1.1      2   2.2     77  86.5        -  SB-IMPL::%WRITE-STRING
  13      1   1.1      2   2.2     78  87.6        -  SB-VM::GENERIC-+
  14      1   1.1      1   1.1     79  88.8        -  (FLET #:CLEANUP-FUN-2067 :IN SB-IMPL::REFILL-INPUT-BUFFER)
  15      1   1.1      1   1.1     80  89.9        -  SB-ALIEN::ALIEN-TYPE-CLASS-OR-LOSE
  16      1   1.1      1   1.1     81  91.0        -  SB-IMPL::OUTPUT-VECTOR
  17      1   1.1      1   1.1     82  92.1        -  SB-IMPL::FLUSH-INPUT-BUFFER
  18      1   1.1      1   1.1     83  93.3        -  TRIGGER-ALL-CAMERAS
  19      1   1.1      1   1.1     84  94.4        -  SB-UNIX:NANOSLEEP
  20      1   1.1      1   1.1     85  95.5        -  "foreign function ldso_stub__poll"
  21      1   1.1      1   1.1     86  96.6        -  SB-IMPL::FD-STREAM-MISC-ROUTINE
  22      1   1.1      1   1.1     87  97.8        -  SB-ALIEN-INTERNALS:%SAP-ALIEN
  23      1   1.1      1   1.1     88  98.9        -  SB-KERNEL:TWO-ARG-<
  24      1   1.1      1   1.1     89 100.0        -  PPRINT-DISPATCH
  25      0   0.0     89 100.0     89 100.0        -  RUN
  26      0   0.0     89 100.0     89 100.0        -  "Unknown component: #x1030664880"
  27      0   0.0     89 100.0     89 100.0        -  SB-EXT:CALL-WITH-TIMING
  28      0   0.0     89 100.0     89 100.0        -  SB-INT:SIMPLE-EVAL-IN-LEXENV
  29      0   0.0     89 100.0     89 100.0        -  EVAL
  30      0   0.0     89 100.0     89 100.0        -  (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL)
  31      0   0.0     89 100.0     89 100.0        -  SWANK::CALL-WITH-RETRY-RESTART
  32      0   0.0     89 100.0     89 100.0        -  SWANK::CALL-WITH-BUFFER-SYNTAX
  33      0   0.0     89 100.0     89 100.0        -  SWANK:EVAL-FOR-EMACS
  34      0   0.0     89 100.0     89 100.0        -  (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD)
  35      0   0.0     89 100.0     89 100.0        -  SWANK-BACKEND::CALL-WITH-BREAK-HOOK
  36      0   0.0     89 100.0     89 100.0        -  (FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/martin/quicklisp/dists/quicklisp/software/slime-2.7/swank-sbcl.lisp")
  37      0   0.0     89 100.0     89 100.0        -  SWANK::CALL-WITH-BINDINGS
  38      0   0.0     89 100.0     89 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1210 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  39      0   0.0     89 100.0     89 100.0        -  (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  40      0   0.0     89 100.0     89 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-645 :IN SB-THREAD::CALL-WITH-MUTEX)
  41      0   0.0     89 100.0     89 100.0        -  SB-THREAD::CALL-WITH-MUTEX
  42      0   0.0     89 100.0     89 100.0        -  SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE
  43      0   0.0     89 100.0     89 100.0        -  "foreign function call_into_lisp"
  44      0   0.0     89 100.0     89 100.0        -  "foreign function new_thread_trampoline"
  45      0   0.0     35  39.3     89 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1286 :IN SB-THREAD:JOIN-THREAD)
  46      0   0.0     35  39.3     89 100.0        -  SB-THREAD:JOIN-THREAD
  47      0   0.0     34  38.2     89 100.0        -  SB-THREAD::%%WAIT-FOR-MUTEX
  48      0   0.0     12  13.5     89 100.0        -  SB-THREAD::CALL-WITH-SYSTEM-MUTEX
  49      0   0.0     12  13.5     89 100.0        -  SB-THREAD:MAKE-THREAD
  50      0   0.0      5   5.6     89 100.0        -  FINISH-OUTPUT
  51      0   0.0      5   5.6     89 100.0        -  SLEEP
  52      0   0.0      4   4.5     89 100.0        -  SB-IMPL::FINISH-FD-STREAM-OUTPUT
  53      0   0.0      4   4.5     89 100.0        -  (LABELS SB-IMPL::HANDLE-IT :IN SB-KERNEL:OUTPUT-OBJECT)
  54      0   0.0      4   4.5     89 100.0        -  PRINC
  55      0   0.0      4   4.5     89 100.0        -  ARDUINO-SERIAL-SBCL::WRITE-ARDUINO
  56      0   0.0      3   3.4     89 100.0        -  SB-IMPL::INPUT-CHAR/ASCII
  57      0   0.0      3   3.4     89 100.0        -  SB-UNIX:UNIX-WRITE
  58      0   0.0      2   2.2     89 100.0        -  ARDUINO-SERIAL-SBCL:SERIAL-RECV-LENGTH
  59      0   0.0      1   1.1     89 100.0        -  SB-ALIEN-INTERNALS:ALIEN-SUBTYPE-P
  60      0   0.0      1   1.1     89 100.0        -  SB-POSIX::ALIEN-POINTER-TO-ANYTHING-OR-NIL
  61      0   0.0      1   1.1     89 100.0        -  SB-IMPL::SYNCHRONIZE-STREAM-OUTPUT
  62      0   0.0      1   1.1     89 100.0        -  SB-IMPL::OUTPUT-BYTES/ASCII
  63      0   0.0      1   1.1     89 100.0        -  SB-IMPL::FD-SOUT
  64      0   0.0      1   1.1     89 100.0        -  SB-IMPL::SYSREAD-MAY-BLOCK-P
  65      0   0.0      1   1.1     89 100.0        -  SB-PRETTY:OUTPUT-PRETTY-OBJECT
  66      0   0.0      1   1.1     89 100.0        -  ARDUINO-SERIAL-SBCL::ENSURE-RESPONSE-BUFFER-CLEAR
------------------------------------------------------------------------
          0   0.0                                     elsewhere
(1 9 9 11 7 2014 4 NIL 0)
Evaluation took:
  171.993 seconds of real time
  73.971000 seconds of total run time (66.121000 user, 7.850000 system)
  43.01% CPU
  483,780,818,953 processor cycles
  4 page faults
  10,180,320 bytes consed
with image processing the acquisition (step=50) takes 215s instead of 170s

i assume that most of the time is spent waiting in the join
unfortunately i don't see which functions needs to be sped up

(8 29 9 11 7 2014 4 NIL 0)
Profiler sample vector full (347 traces / 10000 samples), doubling the size
Profiler sample vector full (692 traces / 20000 samples), doubling the size

Number of samples:   1000
Sample interval:     0.01 seconds
Total sampling time: 10.0 seconds
Number of cycles:    0
Sampled threads:
 #<SB-THREAD:THREAD "worker" RUNNING {100980DE13}>           Self        Total        Cumul
  Nr  Count     %  Count     %  Count     %    Calls  Function
------------------------------------------------------------------------
   1    949  94.9    949  94.9    949  94.9        -  "foreign function syscall"
   2     20   2.0     20   2.0    969  96.9        -  "foreign function __nanosleep"
   3     12   1.2     12   1.2    981  98.1        -  (FLET #:CLEANUP-FUN-586 :IN SB-THREAD::CALL-WITH-SYSTEM-MUTEX)
   4      4   0.4      4   0.4    985  98.5        -  "foreign function write"
   5      2   0.2      2   0.2    987  98.7        -  (FLET #:CLEANUP-FUN-2067 :IN SB-IMPL::REFILL-INPUT-BUFFER)
   6      2   0.2      2   0.2    989  98.9        -  "foreign function ioctl"
   7      1   0.1     24   2.4    990  99.0        -  ARDUINO-SERIAL-SBCL:TALK-ARDUINO
   8      1   0.1     13   1.3    991  99.1        -  SB-THREAD:MAKE-THREAD
   9      1   0.1      5   0.5    992  99.2        -  READ-CHAR
  10      1   0.1      1   0.1    993  99.3        -  "foreign function __poll"
  11      1   0.1      1   0.1    994  99.4        -  SB-UNIX:UNIX-SIMPLE-POLL
  12      1   0.1      1   0.1    995  99.5        -  SB-KERNEL:TWO-ARG-<
  13      1   0.1      1   0.1    996  99.6        -  SB-UNIX:NANOSLEEP
  14      1   0.1      1   0.1    997  99.7        -  SB-ALIEN-INTERNALS:MAKE-ALIEN-VALUE
  15      1   0.1      1   0.1    998  99.8        -  SB-IMPL::OUTPUT-VECTOR
  16      1   0.1      1   0.1    999  99.9        -  "foreign function futex_wait"
  17      1   0.1      1   0.1   1000 100.0        -  SB-IMPL::SPLIT-SECONDS-FOR-SLEEP
  18      0   0.0   1000 100.0   1000 100.0        -  RUN
  19      0   0.0   1000 100.0   1000 100.0        -  "Unknown component: #x1009952950"
  20      0   0.0   1000 100.0   1000 100.0        -  SB-EXT:CALL-WITH-TIMING
  21      0   0.0   1000 100.0   1000 100.0        -  SB-INT:SIMPLE-EVAL-IN-LEXENV
  22      0   0.0   1000 100.0   1000 100.0        -  EVAL
  23      0   0.0   1000 100.0   1000 100.0        -  (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL)
  24      0   0.0   1000 100.0   1000 100.0        -  SWANK::CALL-WITH-RETRY-RESTART
  25      0   0.0   1000 100.0   1000 100.0        -  SWANK::CALL-WITH-BUFFER-SYNTAX
  26      0   0.0   1000 100.0   1000 100.0        -  SWANK:EVAL-FOR-EMACS
  27      0   0.0   1000 100.0   1000 100.0        -  (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD)
  28      0   0.0   1000 100.0   1000 100.0        -  SWANK-BACKEND::CALL-WITH-BREAK-HOOK
  29      0   0.0   1000 100.0   1000 100.0        -  (FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/martin/quicklisp/dists/quicklisp/software/slime-2.7/swank-sbcl.lisp")
  30      0   0.0   1000 100.0   1000 100.0        -  SWANK::CALL-WITH-BINDINGS
  31      0   0.0   1000 100.0   1000 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1210 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  32      0   0.0   1000 100.0   1000 100.0        -  (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  33      0   0.0   1000 100.0   1000 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-645 :IN SB-THREAD::CALL-WITH-MUTEX)
  34      0   0.0   1000 100.0   1000 100.0        -  SB-THREAD::CALL-WITH-MUTEX
  35      0   0.0   1000 100.0   1000 100.0        -  SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE
  36      0   0.0   1000 100.0   1000 100.0        -  "foreign function call_into_lisp"
  37      0   0.0   1000 100.0   1000 100.0        -  "foreign function new_thread_trampoline"
  38      0   0.0    950  95.0   1000 100.0        -  SB-THREAD::%WAIT-FOR-MUTEX
  39      0   0.0    950  95.0   1000 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1286 :IN SB-THREAD:JOIN-THREAD)
  40      0   0.0    950  95.0   1000 100.0        -  SB-THREAD:JOIN-THREAD
  41      0   0.0    949  94.9   1000 100.0        -  SB-THREAD::%%WAIT-FOR-MUTEX
  42      0   0.0     12   1.2   1000 100.0        -  SB-THREAD::CALL-WITH-SYSTEM-MUTEX
  43      0   0.0     10   1.0   1000 100.0        -  SLEEP
  44      0   0.0      5   0.5   1000 100.0        -  ARDUINO-SERIAL-SBCL:READ-RESPONSE
  45      0   0.0      4   0.4   1000 100.0        -  SB-IMPL::REFILL-INPUT-BUFFER
  46      0   0.0      4   0.4   1000 100.0        -  SB-IMPL::INPUT-CHAR/ASCII
  47      0   0.0      4   0.4   1000 100.0        -  SB-UNIX:UNIX-WRITE
  48      0   0.0      4   0.4   1000 100.0        -  SB-IMPL::FLUSH-OUTPUT-BUFFER
  49      0   0.0      4   0.4   1000 100.0        -  SB-IMPL::FINISH-FD-STREAM-OUTPUT
  50      0   0.0      4   0.4   1000 100.0        -  FINISH-OUTPUT
  51      0   0.0      2   0.2   1000 100.0        -  SB-IMPL::SYSREAD-MAY-BLOCK-P
  52      0   0.0      2   0.2   1000 100.0        -  ARDUINO-SERIAL-SBCL::ENSURE-RESPONSE-BUFFER-CLEAR
  53      0   0.0      1   0.1   1000 100.0        -  SB-VM::GENERIC-+
  54      0   0.0      1   0.1   1000 100.0        -  ARDUINO-SERIAL-SBCL:SERIAL-RECV-LENGTH
  55      0   0.0      1   0.1   1000 100.0        -  (LABELS SB-IMPL::HANDLE-IT :IN SB-KERNEL:OUTPUT-OBJECT)
  56      0   0.0      1   0.1   1000 100.0        -  PRINC
  57      0   0.0      1   0.1   1000 100.0        -  ARDUINO-SERIAL-SBCL::WRITE-ARDUINO
------------------------------------------------------------------------
          0   0.0                                     elsewhere
(44 32 9 11 7 2014 4 NIL 0)
Evaluation took:
  215.978 seconds of real time
  260.842000 seconds of total run time (244.861000 user, 15.981000 system)
  [ Run times consist of 1.441 seconds GC time, and 259.401 seconds non-GC time. ]
  120.77% CPU
  607,501,375,689 processor cycles
  1,373,481,728 bytes consed