|
Mehdi Gholam wrote: No references or tests on seeks.
Yes I noticed that too.
|
|
|
|
|
Ummm... what? I don't know how you'd do any random access of a file without Seeks. But maybe you could get a Solid State Disk?
|
|
|
|
|
About 30% of the time is spent in the seeks according to my profiler.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|
Well, if you're not using a database engine and you need to reduce the number of seeks, you'll have to build some kind of caching engine to hold onto chunks of the file, if not all of it, in memory and then access the data from memory instead of disk. Of course, your engine will have to swap pages in and out as needed.
|
|
|
|
|
Mehdi Gholam wrote: better/faster way to do this
do what?
what is in the file: binary data, Unicode text, ASCII text, ...? please provide some details.
why don't you show actual code? please document your problem.
why do you want random access? please provide some context.
|
|
|
|
|
Binary files, it's for my RaptorDB project.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|
I'm not surprised, if you need to seek all the time, you shouldn't rely on an architecture that is built with a number of general-purpose abstraction layers. If I wanted a database without using one, would go one of two ways:
- either use MemoryMappedFile for limited size databases;
- or use basic file operations in C/C++ (P/Invoke!), have all records sector-aligned, and always read/write entire sectors.
|
|
|
|
|
Somebody did memory mapped files with RaptorDB and it was slower, I can't say it was done in an optimized way (like I would do it ) but still.
My problem is not the writing part but the seeks take about 30% of the save time in my profiler.
[As a side note RaptorDB is faster than HamsterDB written in C++]
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|
At work I've been tasked with checking the validity of some URLs that are stored in the database. Some of the files they are supposed to point to have since been deleted and some have disallowed characters -- ampersand (&) and tilde (~) in particular.
Last week I quickly whipped up a method that uses a WebRequest and GetResponse which works just fine. But because it has to download the content of the file before it returns, it takes rather longer than necessary to simply know that the URL is good and the file exists. Today I was experimenting with using BeginGetResponse and Abort in an effort to Abort the download once I know that the file exists, but it seems unreliable (and klugey).
Does anyone here have a better way to determine whether or not a URL points to an existing fie without downloading the file?
|
|
|
|
|
|
Excellent, I just need to try getting some HEAD. Thanks.
Edit: That worked, but didn't help much.
2345 webfiles were checked in 00:11:55.2816915.
Yesterday (with downloading) it took sixteen minutes.
Edit 2: I'm now spinning off threads (up to ten) and the total elapsed time is down to a minute and a half.
modified 12-Oct-11 0:50am.
|
|
|
|
|
Holy moly, I was just telling my coworker that there must be some solution to the problem that you have asked about. I will send him the answer posted by the other responder.
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
Whatever you come up with isn't going to be 100% reliable. You run the risk of removing valid entries simply because the web server is down. Don't forget to check the return status codes of those responses that come back to ensure you can take an appropriate action at a later date.
|
|
|
|
|
Great point easily missed.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|
Well yes, but so far I'm only looking at 400s and 404s and reporting them. I hesitate to write anything that would remove them from the database automatically.
|
|
|
|
|
I want to read the content of existing excel file using java script, and then download the file with those contents.
Thanks.
|
|
|
|
|
So what does Java Script have to do with the .NET Framework??
|
|
|
|
|
By mistake i posted under .net forum instead of java script.
|
|
|
|
|
I have decided to use the CssSpriteGenerator code to automaticallty generate image sprite in my ASP.net 4.0 website [http://www.codeproject.com/KB/aspnet/cssspritegenerator.aspx]. I have encountered a problem that I can't solve. I will explain.
I am storing all my icons (to be used in the sprite generator) in the "img/icons" folder. I've configured the web.config with the appropriate configuration. I want all the files in the img/icons folder to be used for the sprite and those who appear in the x.aspx to be inserted into the sprite and their images converted.
I am using the following CssSpriteGenerator configuration:
<cssSpriteGenerator active="Always" inlineSpriteStyles="false" processFolderImages="Always" imageFolderPathMatch="\\img\\icons\\" >
<imageGroups>
<add groupName="icons" pixelFormat="Format32bppPArgb" spriteImageType="Png" filePathMatch="(gif|png)$" />
</imageGroups>
</cssSpriteGenerator>
<combineAndMinify active="Always" inlineSpriteStyles="false" preloadAllImages="true"/>
The problem is that I can't get the code to work, means that the images stay as they are. I tried other options but I only get mt logo.png (which is on the masterpage) to be replaced with a CSS Sprite.
I wanted to know what type of configuration I need to use in order for it to work.
Please help me out, I'm breaking my head for hours on this one.
Thanks in advanced.
|
|
|
|
|
1. This has nothing to do with the .NET framework.
2. If you have a problem with someone's article then use the forum at the end of the article to contact the author.
|
|
|
|
|
Preface : In these series of question I will be shining a light on the more obscure parts of the .net framework, which I have used or found interesting in the hope of sparking a discussion and receiving your thoughts on the subject.
Part 1 : Threads
There are a the following methods found on the Thread object
Thread.SetData<br />
Thread.GetData<br />
Thread.GetNamedDataSlot
With these methods you can store data on a thread in a "NamedSlot" kind of like a key value pair, which will travel around with the thread and can be accessed by making the GetData call.
I have found them indispensable for implementing transaction processor within my applications which store a TransactionID on the thread and rollback or commit that ID when everything is done.
Kudos to .net team for implementing these methods.
Have you used these methods before? Your thoughts and comments please.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|
Eh? What is the point of this question? If you want to shine a light on obscure parts of the framework, write an article on them.
|
|
|
|
|
Thanks,
I was hoping for a discussion on the subject.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|
What good would that serve anybody? As threads are added, it would drop down the list so it would disappear from view.
|
|
|
|
|
Fair point, I will go and sob in the corner now.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|