Skip to main content
Tweeted twitter.com/#!/StackCodeReview/status/373599902372495360
Added note about std::string
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

Note: Using std::string in my project is unfortunately forbidden.

Note: Using std::string in my project is unfortunately forbidden.

Removed tag from title; fixed some grammar and spelling; added 'optimization' tag
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

How to improve my list in C++list's speed

I'm wondering how toI could improve the speed of adding elements to my listlist's element-adding speed or just how to speed up the whole list implementation. Function which adds new elements

The adding function first checks if the object would beis unique. If not, it will just check if the new data is better (the lower the value, the better) thatthan the old one and, then swap the values or just skip adding an element. 

I have no idea how to make it work faster, but I know that something here is probably done terribly wrong. I need to use that list to add about 3 milionmillion elements in less than 4 seconds. I enclose the code below:

How to improve my list in C++

I'm wondering how to improve the speed of adding elements to my list or just how to speed up the whole list implementation. Function which adds new elements first checks if object would be unique. If not it will just check if the new data is better (the lower value the better) that the old one and swap the values or just skip adding element. I have no idea how to make it work faster but I know that something here is probably terribly wrong. I need to use that list to add about 3 milion elements in less than 4 seconds. I enclose the code below:

How to improve my list's speed

I'm wondering how I could improve my list's element-adding speed or just the whole list implementation.

The adding function first checks if the object is unique. If not, it will just check if the new data is better (the lower the value, the better) than the old one, then swap the values or just skip adding an element. 

I have no idea how to make it work faster, but I know that something here is probably done terribly wrong. I need to use that list to add about 3 million elements in less than 4 seconds.

Source Link
Loading