Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 3, 2022 10:51 pm GMT

I Created The Fastest C Strings System Ever!

I am now working on a private database project, the main goal of creating a new database system is that I need to increase the speed of the system, and this is what I do not find in the available databases.

Since the system will deal mainly with strings of characters, it was necessary to create a system dedicated to dealing with these strings faster than the default system in the C++ language.

Therefore, I developed this simple system, which greatly contributed to increasing the speed of implementation and reducing the consumed resources by about 5 times.

What I'm showing you now is a header file from the xeerx project that I'm working on right now but I wanted to share it with you for your benefit.

Also, I want expert opinions. Is the system good? Does it need more improvement? Is there anything I can do to increase speed and performance?

Some performance experiments compared to std::string :

|operation--|x::xstring-|std::string|create-----|41s-------|123s|append-----|21s-------|125s|prepend----|19s-------|14s|first_of---|15s-------|21s|last_of----|14s-------|42s|sub--------|60s-------|218s|compare----|4s--------|27s|copy-------|42s-------|65s|getChar----|2s--------|8s|getIndex---|6s--------|16s|getLast----|2s--------|11s|pop--------|2s--------|23s|pop_last---|9s--------|21s|reverse----|48s-------|651s|empty------|2s--------|5s|clear------|2s--------|27s

You can find the file at this link on Github


Original Link: https://dev.to/xeerx/i-created-the-fastest-c-strings-system-ever-4121

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To