2015-01-04T00:20:53Z eudoxia_ quit (Quit: Leaving) 2015-01-04T00:56:52Z Bicyclidine quit (Ping timeout: 240 seconds) 2015-01-04T01:21:50Z nikki93: I'm generating ids for stuff to store in a hash table 2015-01-04T01:21:59Z nikki93: how do I know what are good ids to generate? 2015-01-04T01:22:08Z nikki93: currently I'm starting at 0 and just incrementing 2015-01-04T01:22:21Z nikki93: ids will be free and can be reclaimed etc. 2015-01-04T01:22:59Z nyef: clhs genhash 2015-01-04T01:22:59Z specbot: Couldn't find anything for genhash. 2015-01-04T01:23:01Z nyef: Hrm. 2015-01-04T01:23:03Z nikki93: (think of it as a database with multiple tables storing data about people, each with an id, new people need to get a newly generated id, but also people may leave and when that happens their entry is deleted from all tables) 2015-01-04T01:23:12Z nyef: Oh, what was the function...? 2015-01-04T01:23:35Z nyef: Basically, pick something with a decent approximation to an IID distribution and you should be fine. 2015-01-04T01:23:42Z Bicyclidine joined #sbcl 2015-01-04T01:23:46Z nyef: clhs sxhash 2015-01-04T01:23:46Z specbot: http://www.lispworks.com/reference/HyperSpec/Body/f_sxhash.htm 2015-01-04T01:23:50Z nyef: That was it. 2015-01-04T01:24:05Z nyef: Figure that anything going into a hash table will be subject to sxhash. 2015-01-04T01:24:14Z nyef: And everything else, to RANDOM. 2015-01-04T01:25:00Z nikki93: ok ... well I am free to choose the key type 2015-01-04T01:25:12Z nikki93: just need to generate keys 2015-01-04T01:25:35Z nikki93: there won't be more than max positive fixnum number of people at a time for sure 2015-01-04T01:25:53Z nyef: So, successive fixnums shouldn't be a big deal. 2015-01-04T01:26:10Z nyef: Also, hello? Premature optimization. d-: 2015-01-04T01:26:24Z nikki93: haha well I profiled my thing and this is basically the bottleneck 2015-01-04T01:26:27Z nikki93: the bottleneck is gethash 2015-01-04T01:26:50Z nikki93: but actually tho this shoudln't be the bottleneck in a real game ... I'm doing this with 30,000 sprites that basically just oscillate and rotate around 2015-01-04T01:26:52Z nyef: Then maybe a hash table is the wrong structure? 2015-01-04T01:27:11Z nikki93: how would you store a database of infos for things then 2015-01-04T01:27:34Z nikki93: what I can do: I am free to generate whatever id I want, and I need to lookup data by id, and ids can be 'freed' 2015-01-04T01:27:44Z nikki93: what's good for that 2015-01-04T01:28:05Z nikki93: the actual id doesn't matter, i just need to a unique one when I ask "next id please" 2015-01-04T01:28:19Z nyef: Hrm... A vector? 2015-01-04T01:29:16Z nikki93: so that's another idea -- is to keep ids dense as possible and use a vector 2015-01-04T01:29:54Z nyef: And this is more general talk, and thus would have been better in #lisp. d-: 2015-01-04T01:30:56Z nikki93: oh ok -- I thought it'd depend on the hash table implementation 2015-01-04T01:31:25Z |3b|: where do you get the ID to look up in the hash table, and could the actual value have been stored there instead? 2015-01-04T01:31:29Z nyef: It would and it wouldn't. The spec requires certain things of the default hash function, for example. 2015-01-04T01:31:43Z nyef: Oh, there you go. 2015-01-04T01:32:41Z nikki93: |3b|: the object is defined purely by getting a new id first, and then storing things at that id in a hash table, and then to ask things of the object you look up in the hash table 2015-01-04T01:33:37Z |3b|: at some point you pick an ID to look up in the hash table, i assume you don't pick with RANDOM, so it was probably stored somewhere 2015-01-04T01:33:52Z nyef: That seems mighty thin. Why not use classes instead? 2015-01-04T01:34:12Z |3b|: that somewhere could have stored a reference to the object directly, unless the object associated with an ID changes frequently 2015-01-04T01:34:16Z nikki93: nyef: cuz you can add an id and remove from any table whenever you want. you can mix functionality in a pretty sweet way 2015-01-04T01:34:32Z |3b|: (and more change than could be handled with change-class or whatever) 2015-01-04T01:34:43Z nikki93: there is a table of "monster data" and then a table of "sprite data" and then "position data" etc. 2015-01-04T01:34:52Z |3b|: ah, lots of independent tables 2015-01-04T01:34:56Z nikki93: and a monster might be in all 3, while a player is in just sprite and position and probably a diff table called "player data" or something 2015-01-04T01:35:13Z |3b|: and you want to iterate the values in a particular table sometimes? 2015-01-04T01:35:15Z nikki93: if you had "rotating things" then you make a rotating monster by adding to monster and also to rotating 2015-01-04T01:35:21Z nikki93: |3b|: yup 2015-01-04T01:36:00Z nikki93: the other nice thing is that the seprate tables handle their own serialization/deserialization and stuff 2015-01-04T01:36:02Z |3b|: if gethash is taking up too much time, maybe you want some redundancy, for example storing a list (or other mapping) of tables the object is in, in addition to storing it in the table 2015-01-04T01:36:27Z nikki93: and also since its all centralized everyone can do their own data structures too (transform can keep a tree, sprite can keep an OpenGL VBO) 2015-01-04T01:36:31Z |3b|: and refer to objects directly rather than by ID 2015-01-04T01:36:49Z nikki93: |3b|: that would be one way 2015-01-04T01:37:08Z nikki93: (the transform tree I mentioned is for like a scenegraph) 2015-01-04T01:38:28Z nikki93: |3b|: I guess it's like caching it sorta? 2015-01-04T01:44:51Z attila_lendvai quit (Quit: Leaving.) 2015-01-04T02:02:38Z nikki93 quit 2015-01-04T02:12:32Z slyrus joined #sbcl 2015-01-04T02:43:28Z psilord joined #sbcl 2015-01-04T03:12:43Z echo-area quit (Remote host closed the connection) 2015-01-04T03:13:42Z echo-area joined #sbcl 2015-01-04T03:39:32Z christoph_debian quit (Ping timeout: 265 seconds) 2015-01-04T03:52:37Z christoph_debian joined #sbcl 2015-01-04T03:54:05Z npatrick04 joined #sbcl 2015-01-04T04:51:26Z oleo is now known as Guest34380 2015-01-04T04:52:21Z oleo__ joined #sbcl 2015-01-04T04:54:17Z Guest34380 quit (Ping timeout: 240 seconds) 2015-01-04T05:51:29Z scymtym joined #sbcl 2015-01-04T05:54:13Z npatrick04 quit (Remote host closed the connection) 2015-01-04T06:21:22Z nyef quit (Quit: G'night all.) 2015-01-04T07:06:19Z oleo__ is now known as oleo 2015-01-04T07:07:06Z oleo quit (Quit: Verlassend) 2015-01-04T07:07:13Z stassats joined #sbcl 2015-01-04T07:08:32Z pacon joined #sbcl 2015-01-04T07:09:25Z oleo joined #sbcl 2015-01-04T07:09:34Z oleo quit (Changing host) 2015-01-04T07:09:34Z oleo joined #sbcl 2015-01-04T08:35:41Z gingerale joined #sbcl 2015-01-04T09:21:36Z echo-are` joined #sbcl 2015-01-04T09:22:59Z echo-area quit (Ping timeout: 264 seconds) 2015-01-04T09:29:22Z scymtym quit (Ping timeout: 255 seconds) 2015-01-04T09:33:11Z Bicyclidine quit (Ping timeout: 264 seconds) 2015-01-04T09:48:19Z gingerale quit (Ping timeout: 265 seconds) 2015-01-04T10:14:16Z stassats quit (Ping timeout: 244 seconds) 2015-01-04T10:29:49Z Bicyclidine joined #sbcl 2015-01-04T10:41:07Z scymtym joined #sbcl 2015-01-04T11:42:55Z echo-are` quit (Read error: Connection reset by peer) 2015-01-04T11:55:30Z gabriel_laddel quit (Remote host closed the connection) 2015-01-04T12:12:47Z stassats joined #sbcl 2015-01-04T12:47:44Z _8hzp joined #sbcl 2015-01-04T12:49:37Z hzp quit (Ping timeout: 240 seconds) 2015-01-04T12:53:55Z _8hzp quit (Ping timeout: 265 seconds) 2015-01-04T13:02:22Z Bicyclidine quit (Ping timeout: 245 seconds) 2015-01-04T13:11:52Z stassats quit (Ping timeout: 240 seconds) 2015-01-04T13:29:24Z Bicyclidine joined #sbcl 2015-01-04T13:44:27Z alchemis7 quit (Remote host closed the connection) 2015-01-04T13:46:30Z alchemis7 joined #sbcl 2015-01-04T14:37:06Z gingerale joined #sbcl 2015-01-04T14:45:26Z nyef joined #sbcl 2015-01-04T15:11:52Z pacon quit (Read error: Connection reset by peer) 2015-01-04T15:26:08Z stassats joined #sbcl 2015-01-04T16:31:38Z edgar-rft quit (Quit: computation destroyed into mental vacuum) 2015-01-04T16:32:13Z nyef quit (Quit: Gone for a bit) 2015-01-04T16:40:39Z oleo quit (Quit: Verlassend) 2015-01-04T16:41:29Z oleo joined #sbcl 2015-01-04T16:47:52Z karswell joined #sbcl 2015-01-04T17:02:57Z psy quit (Ping timeout: 244 seconds) 2015-01-04T17:09:30Z davazp joined #sbcl 2015-01-04T17:13:43Z karswell quit (Remote host closed the connection) 2015-01-04T17:13:52Z karswell joined #sbcl 2015-01-04T17:14:28Z oleo is now known as Guest97615 2015-01-04T17:15:02Z oleo__ joined #sbcl 2015-01-04T17:17:19Z Guest97615 quit (Ping timeout: 245 seconds) 2015-01-04T17:52:39Z oleo__ quit (Quit: Verlassend) 2015-01-04T17:54:41Z davazp quit (Remote host closed the connection) 2015-01-04T17:54:42Z oleo__ joined #sbcl 2015-01-04T17:54:56Z oleo__ quit (Read error: Connection reset by peer) 2015-01-04T17:56:28Z oleo joined #sbcl 2015-01-04T18:11:33Z krzysz00 quit (Quit: leaving) 2015-01-04T18:20:14Z eudoxia joined #sbcl 2015-01-04T18:29:57Z stassats quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2015-01-04T18:55:45Z psy joined #sbcl 2015-01-04T18:58:20Z karswell quit (Read error: Connection reset by peer) 2015-01-04T18:58:35Z karswell joined #sbcl 2015-01-04T20:01:00Z psy quit (Ping timeout: 244 seconds) 2015-01-04T20:26:08Z alchemis7 quit (Read error: Connection reset by peer) 2015-01-04T20:26:41Z alchemis7 joined #sbcl 2015-01-04T20:28:43Z psy joined #sbcl 2015-01-04T20:33:35Z hzp joined #sbcl 2015-01-04T20:49:07Z nikki93 joined #sbcl 2015-01-04T20:56:09Z nyef joined #sbcl 2015-01-04T21:04:39Z phf` left #sbcl 2015-01-04T21:14:43Z DeadTrickster quit (Ping timeout: 272 seconds) 2015-01-04T21:43:34Z scymtym quit (Ping timeout: 245 seconds) 2015-01-04T21:54:36Z pacon joined #sbcl 2015-01-04T21:56:59Z oleo quit (Quit: Verlassend) 2015-01-04T22:02:31Z oleo joined #sbcl 2015-01-04T22:25:34Z pacon quit (Read error: Connection reset by peer) 2015-01-04T22:26:11Z oleo quit (Ping timeout: 265 seconds) 2015-01-04T23:00:16Z Bicyclidine quit (Ping timeout: 255 seconds) 2015-01-04T23:15:20Z drichards joined #sbcl 2015-01-04T23:17:51Z nikki93 quit (Read error: Connection reset by peer) 2015-01-04T23:18:18Z nikki93 joined #sbcl 2015-01-04T23:26:48Z Bicyclidine joined #sbcl 2015-01-04T23:33:01Z attila_lendvai joined #sbcl 2015-01-04T23:45:33Z eudoxia quit (Quit: Leaving)