Skip to content

Commit

Permalink
micro optimizations.
Browse files Browse the repository at this point in the history
removing a lot of mallocs through strdup  by replacing getcommand calls with get_command, which takes a buffer. only one left.
removing mkname calls with a static buffer for keyword-tokens.
commit the schema file I had lying around.
  • Loading branch information
ennorehling committed Aug 14, 2014
1 parent 9ca206e commit dafe71f
Show file tree
Hide file tree
Showing 10 changed files with 3,292 additions and 3,194 deletions.
6 changes: 6 additions & 0 deletions schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE email(id INTEGER PRIMARY KEY, md5 VARCHAR(32) UNIQUE NOT NULL, email VARCHAR(32), bounces INT DEFAULT 0, confirmed TIMESTAMP DEFAULT NULL);
CREATE TABLE faction (id INTEGER PRIMARY KEY, user_id INTEGER REFERENCES user(id), no INTEGER, name VARCHAR(64), game_id INTEGER REFERENCES game(id), race VARCHAR(10), lang CHAR(2));
CREATE TABLE faction_email (faction_id INTEGER REFERENCES faction(id), email_id INTEGER REFERENCES email(id));
CREATE TABLE game (id INTEGER PRIMARY KEY, name VARCHAR(20), last_turn INTEGER);
CREATE TABLE score (turn INTEGER, faction_id INTEGER REFERENCES faction(id), value INTEGER, UNIQUE(turn, faction_id));
CREATE TABLE user(id INTEGER PRIMARY KEY, email_id INTEGER REFERENCES email(id), creation TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
Loading

0 comments on commit dafe71f

Please sign in to comment.