changelog shortlog graph tags branches changeset file revisions annotate raw help

Mercurial > demo / examples/db/cl-simple-example.lisp

revision 37: c6d0a37a046a
parent 36: 0f678bfd8699
child 38: 8259376eee11
     1.1--- a/examples/db/cl-simple-example.lisp	Tue Dec 19 16:52:10 2023 -0500
     1.2+++ b/examples/db/cl-simple-example.lisp	Sun Dec 24 19:24:39 2023 -0500
     1.3@@ -1,4 +1,4 @@
     1.4-;;; cl-simple-example.lisp --- Common Lisp port of rocksdb/example/c_simple_example.c
     1.5+;;; cl-simple-example.lisp --- Common Lisp port of rocksdb/examples/c_simple_example.c
     1.6 
     1.7 ;; ref: https://github.com/facebook/rocksdb/blob/main/examples/c_simple_example.c
     1.8 
     1.9@@ -32,18 +32,14 @@
    1.10 |#
    1.11 
    1.12 ;;; Code:
    1.13-(defpackage :examples/rdb/cl-simple-example
    1.14-  (:nicknames :cl-simple-example)
    1.15+(defpackage :examples/cl-simple-example
    1.16   (:use :cl :std :cli :rdb :sb-alien :rocksdb)
    1.17   (:export :main))
    1.18 
    1.19-(rocksdb:load-rocksdb :save t)
    1.20-
    1.21-(in-package :cl-simple-example)
    1.22+(in-package :exmaples/cl-simple-example)
    1.23+(declaim (optimize (speed 3)))
    1.24 
    1.25-(in-readtable :std)
    1.26-
    1.27-(defvar *num-cpus* (alien-funcall (extern-alien "sysconf" (function long integer)) sb-unix:sc-nprocessors-onln)
    1.28+(defvar *num-cpus* (alien-funcall (extern-alien "sysconf" (function int int)) sb-unix:sc-nprocessors-onln)
    1.29   "CPU count.")
    1.30 
    1.31 (defparameter *db-path* "/tmp/rocksdb-cl-simple-example")
    1.32@@ -52,8 +48,7 @@
    1.33 
    1.34 (defmain ()
    1.35   ;; open Backup Engine that we will use for backing up our database
    1.36-  (let ((options 
    1.37-          (make-rocksdb-options 
    1.38+  (let ((options (make-rocksdb-options 
    1.39                   (lambda (opt)
    1.40                     (rocksdb-options-increase-parallelism opt *num-cpus*) ;; set # of online cores
    1.41                     (rocksdb-options-optimize-level-style-compaction opt 0)