freenode/lisp - IRC Chatlog
Search
11:18:13
beach
Once I get around to implementing structs in SICL, they will have the same nice properties as standard classes, simply because in SICL, every heap-allocated object except CONSes have a two-word header and a separate contents vector.
11:20:43
beach
shka: No the tag is in the pointer that points to it. The header contains a pointer to the class and a pointer to the contents vector (that I call a "rack").
11:22:33
specbot
upgraded-array-element-type: http://www.lispworks.com/reference/HyperSpec/Body/f_upgr_1.htm
11:24:14
beach
dim: An array (even a specialized one) must be represented by a pointer to some heap-allocated data, so if you want to store those in another array, that other array needs to be able to hold a pointer. Most implementations would then use T as the upgraded array element type.
11:26:06
shka
actually, some implementations extend upon the above and allow stack allocated arrays (but that's extension to standard)
11:30:39
dim
basically what I have is a batch of "rows" and each row is a set of columns, each column is a string
11:31:28
dim
then I prepare those columns for sending to PostgreSQL in the copy format, so then I (should) have a batch of simple-strings
11:38:26
jdz
I once tried PG's COPY thing, and it was way slower than doing queries (using postmodern).
11:44:25
dim
so you did one insert at a time? or prepared a batch with many rows in the value statement?
11:44:44
dim
see https://www.depesz.com/2007/07/05/how-to-insert-data-to-database-as-fast-as-possible/
11:45:14
dim
copy did the job in 17.02 seconds --- best possible way of inserting with multiple rows was using 100 rows per statement, 100 statements per transaction, using prepared statements – it did it's work in 37.73 seconds.
12:47:58
pjb
If you use defclass, normally you should write (or update) a update-instance-for-redefined-class method each time you modify the defclass.
12:49:57
pjb
On the other hand, when you write applications (executable images), you have so many times to deal with that it is just easier to avoid data crossing them. Ie. you have to minimize the data that is saved in your image, because most of it would become invalid anyways when the user reboots it.
12:50:35
pjb
all the open files and streams, all the foreign data, foreign libraries, etc. So adding structures to the mix is not a big deal.
12:51:10
pjb
Basically, defvar/defparameter with initial forms is a no-no, instead you set them to nil, and have a initialize function called at boot time.
12:53:16
dim
ok after some careful consideration and a host of optimisation, I now deal with :type '(simple-array (unsigned-byte 8))
12:53:47
pjb
Even the model we're using with slime, where we keep source files in an external file system to be recompiled/reloaded, imposes a development style and structure on the lisp image that is antinomic to the notion of persistent objects.
12:54:17
dim
(rather than using vector-push-extend I now count how many bytes are needed and pre-allocate the result at the right size already) (it costs an extra traversal but I think it's worth it in a memory hungry application)
12:55:14
dim
it's very rare that I have interactive things in cl-user (say) to play with in between calls and refactorings
13:04:15
dim
I usually don't, I have test cases that are more like integration tests than unit-tests, those will recreate all I need
13:04:42
dim
e.g. with pgloader I test my edits with doing a full SQLite or MySQL migration to PostgreSQL, those tests run for 2.5s and 0.6s resp.