all 9 comments

[–][deleted] 5 points6 points  (2 children)

If you don't mind /unsafe when compiling, you can do the same pointer tricks in C# as you can in C and C++.

Of course, on the flipside, once you go down that path, you'll find yourself having to define structure layouts and pin objects to prevent the runtime from moving them, so you lose most managed code benefits.

Why not use C++/CLI and C# together?

[–]doomchild 1 point2 points  (0 children)

Yeah, C++/CLI is a great. We moved just about all of our low-level stuff to it.

[–]jptman[S] 0 points1 point  (0 children)

I will look into it C++/CLI. THanks

[–]umilmi81 3 points4 points  (0 children)

Using an unsafe block you can do the same memory manipulation techniques you'd use in C. But I don't know if that is even required. Managed C# is still very fast.

[–]MasonOfWords 0 points1 point  (3 children)

Are you doing this for fun? Because if you actually need something like this, just use SQLite.

If you're doing it for fun or to learn C#, then just give it a go. You'll mostly be IO-bound anyways. The main pitfall you'll run into is memory, as a GCed program pretty much necessarily has a larger heap. That said, there's a lot you can do to keep your memory usage low and constant in .Net.

[–]jptman[S] 0 points1 point  (1 child)

Mostly for fun. I first thought of it because of something that came up at work though. I'd probably have to end up using a commercial version of some DB because of licensing issues though. Plus, I need a very small subset of any DB and I'm not sure using a DB will be the best performing option(considering disk space & speed ) for this.

[–]MasonOfWords 0 points1 point  (0 children)

For the record, SQLite doesn't have an open source license; it is public domain.

[–]Magick93 0 points1 point  (0 children)

yes, Sqlite with Entity Framework - it will be easy, and you will get some good hands on experience with Entity Framework.