Implementing new features

Discussion re sg development. You don't have to be a developer.

Implementing new features

Postby maratheamit » Sun Apr 11, 2004 8:19 pm

We currently map each feature to a unique prime number and keep track of which features have been enabled by a user by storing the product of the corresponding primes.

This is not very scalable. The product is stored in a bigint and we will run out of space after a few more features. If possible, we should move to a bitmap implementation which will scale to a
lot more features and also be more time efficient.
maratheamit
 
Posts: 82
Joined: Fri Aug 29, 2003 2:35 pm

Postby josh » Wed Apr 14, 2004 8:41 am

bigint is pretty big, isn't it? bitmap would allow for more of course, but how many features will we have?
josh
 
Posts: 1371
Joined: Fri Aug 29, 2003 2:28 pm

Postby SysKoll » Wed Apr 14, 2004 4:32 pm

I second Amit's suggestion. A bitmap is The Right Way to implement it anyway. Plus, to parse the option bigint right now, you have to do quite a lot of CPU-intensive calculations, whereas a regular bitmap would offer you a clean way to store 32 or 64 options right off the bat.
-- SysKoll
SysKoll
 
Posts: 893
Joined: Thu Aug 28, 2003 9:24 pm

Postby maratheamit » Thu May 27, 2004 1:43 pm

Now that all the code is in CVS with proper tags how about pushing through this change. It should be very simple to move to the bitmap field for feature flag storage: my estimate is that it won't involve more than 2-3 hours of coding/testing.

I am assuming that we have access to the web server machine: the perl cgi code will need to change along with the mailhandler code.
maratheamit
 
Posts: 82
Joined: Fri Aug 29, 2003 2:35 pm

Postby josh » Thu May 27, 2004 7:03 pm

we can change the webserver code as needed. We'd need to "upgrade" the data we have, right?

We can put this off, if we like -- I don't think it's much of an issue currently.
josh
 
Posts: 1371
Joined: Fri Aug 29, 2003 2:28 pm

Postby SysKoll » Thu May 27, 2004 7:19 pm

Josh,

We will need the feature map ASAP anyway. Yes, we'll need to change the data. Once we have the mapping of the features as bitmap, we can write a small script that factors the bigints and converts them into the corresponding bitmap.
-- SysKoll
SysKoll
 
Posts: 893
Joined: Thu Aug 28, 2003 9:24 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 18 guests

cron