Chris R's Weblog
Visit Rory Blyth's blog. He worked at Microsoft and now he's a writer

Daily link December 9th, 2007

2 new videos before I leave this fine Sunday

Gaze at the wonder that is my Sunday!
By the way, these were just uploaded so they won’t be encoded by youtube for a few minutes or hours, just keep checking back compulsively until they appear.

Daily link December 9th, 2007

Where am I at.

While this is pseudo code and the actual code is thousands of lines, this is approximately what is going on. Minus the text searching functions.

So while this is not extra-ordinary and retardedly easy to understand, I am posting it just to give you a little idea of the memory manager. Like I said this is very pseudocode, because the actual code is far more complex. I am finishing the IPC with the socket file now.

g_main_pointer = malloc(some_huge_amount);

// dump from db file dumps into memory
// fopen(”filenum”, “r”)
// iterate into structs here
typedef struct oRecord {
type somedata1;
type somedata2;
} *PRECORD;
oRecord rc;
memcpy(rc.something, &from_file_stream[offset], sizeof(data));
memcpy(&g_main_pointer[offset, (void*)&rc, sizeof(rc));
// fclose

PRECORD baseRecord = (PRECORD)g_main_pointer;
for (int i = 1; i < 30; i++) {
PRECORD pcRecord = &baseRecord[i];
printf(”STR%d: %s\n”, i, pcRecord->somedata);
}

free(g_main_pointer);

Since the data is all dumped from the initial DB into terabytes of 1.3 meg files, it reads in files for gigabytes of memory caching until it runs out. Then it notes the last file read, and if the search overruns the records in memory, then it starts pumping through the rest of the 1.3 meg files. 1.3 meg files are key because a huge file like a VPC hard disk or whatever will mean a LONG fseek to the right position in the stream. On Linux this would mean a lot of stress on the VFS subsystem in the kernel and the driver for the disk. So it’s almost like a little pseudo filesystem table and there is an index that keeps all the records and the pagerank tables.

Each record in the 1.3 meg files is kept to 255 * bytes exactly so it can be iterated through easily. I limited it to 255 chars to retain speed. Since 21 or so fields are shoved into such a small space the accuracy of the search is greatly reduced.

I have to buy parts from Tiger Direct where as the other engines can get custom hardware with 20-50 RAM sockets. It’s not a very fair fight to say the least, so I have to do it this way to keep the speed up. We have lots of 1U’s but they are not custom. They are stock, with stock parts. Parts you can buy at TigerDirect.ca

Daily link December 9th, 2007

I’m converting everything to structs in the memory

I thought I could save time by simply dumping the files into the memory without making structs first, but now it’s inconvenient, so I am doing everything as data structs in the big allocated pool. God this is boring.

BTW, it’s not that it didn’t work just dumping file data straight in. It worked, but it’s inconvenient and it looks bad in the code when doing pattern matching for results.

This search should be as nice on the inside as it is on the outside.

Daily link December 9th, 2007

Fixed lengths fixing the speed problem

I switched from delimiters to fixed lengths. This makes searches faster. Of course it means that you have to waste space by whitespacing values that are too short, but in the end the speed difference makes up for the wasted space.

Fixed memory lookups are extremely fast now. I’m happy with the speed even on commercial hardware.

Daily link December 9th, 2007

Our first profit in over a year and a half - July 2008

One July 1rst 2008 we are no longer going to pay govt of Canada any money any more. Our payments will drop from several thousand dollars per month to zero dollars in an instant when the clock ticks midnight on June 30 2008. We’re going to peel these little suckers right off. The suckers that ate us and gave our money to Just for Laughs, Celine Dion and of course that idiot that sits there and plays video games with our tax dollars and shows everybody on cable TV that he just did that, Victor Lucas.

http://msnbcmedia3.msn.com/j/msnbc/Components/Photos/040628/040628_leeches_hmed.hmedium.jpg

So on June 30th 2008 BeerCo Canada is dissolved, and BeerCo USA in California will be the only entity of the company worldwide.
During the rest of 2008, I will post, not huge gross profits along with shattering net losses, but NET, yes, NET profits for the first time since December 2006. I will post profits from our SEO campaigns which have low overhead and high yield and I will show everyone including govt of Canada on my blog what we are starving them of.

The “honorable” Harper will no longer be financed to drive these with BCS money:

The image “http://farm3.static.flickr.com/2347/2097207783_001edddfbc.jpg?v=0” cannot be displayed, because it contains errors.

But will rather be reduced to this:

The image “http://farm3.static.flickr.com/2307/2097207793_5c9b113f3b.jpg?v=0” cannot be displayed, because it contains errors.

Well, let’s hope so anyway.

So I will be very pleased with this development, and I will continue to post our financials. Except from July 1, 2008 on, they will actually be positive. I am already aware of tax rates in Califorinia and while they are higher than most of the rest of the states, they are exponentially less than here. Probably because the US govt does not do wide spread socialist fund re-appropriation with people’s money. I never wanted to fund Celine Dion and Victor Lucas’s video game show. They made me. I’m NOT ok with that.

I’m not ok with 95% of the stuff they do with our money, and they take so much it closes business down here. If they REALLY wanted to tax US companies coming in here with franchises and that was the real goal of their tax rape system, then they should have explicitly taxed US companies like Wal-mart in a prejudice way. What they did was make sure that no home grown businesses can ever succeed on a global scale, and they made it so that only companies with world distributers and branches can succeed at zero overhead rates with slave labor.


December 2007
M T W T F S S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930
31  
BeerCo on YouTube (BCS videoblog)
Photoblog
(on Flickr)
Main RSS Feed
Link Blog (tech news from SiteSpaces.net)
Add to Technorati Favorites
About me
Comment RSS Feed
Click to see the XML version of this web page.


Chris R. works at BeerCoSoftware.com (title: President of Development and Sales). This is Chris's work blog.

Disclaimer: BCS will not let personal views of any employee, including Chris, regarding any software product, company, standards or otherwise get in the way of any company that hires it to provide a solution. Companies pay BCS and BCS provides solutions regardless of the views of any employee. That’s part of being professional, and BCS is a professional software company.

Everything here is Chris's personal opinion and is not read or approved before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else on this blog.

Login
Blog at WordPress.com.
InstaSize Online and Square InstaPic – Photo Editor for your PC.

How To Fix Svchost.Exe Netsvcs High CPU Usage Problem ? Solved: Netsvcs High CPU