1.

Solve : Bloodshed Dev C++ lagging out on a 24,947 line program?

Answer»

Working on a C++ project that is 24,947 lines and was created using Bloodshed Dev C++, as the program started getting larger I noticed that going into the code and making a change, if i backspace to change something I am able to make the change, but get a cartwheel for 5 seconds and then bloodshed dev c++ acts fine. This wasnt happening when the program was smaller and to avoid typing all that code mostly switch case statements I copy pasted to replicate the source and then am going back in and editing the logic manually line for line on what to do for each case. Its almost like the change of anything in the program of this size its having to accept the change to the IDE and then run something maybe a cached copy of the 24,947 lines of code before it unfreezes. The freeze lasts about 5 seconds and happens only when editing/altering code. If I create a new line of code there is no lag.

Anyone out there work with Bloodshed Dev C++ to know the cause and fix for this "cache lag"? or another Free C++ IDE that works well with large programs. The majority of the lines of source are long switch statements with a vast quantity of matching cases and what to do upon a match etc. Unfortunately there is no way to reduce the size of the program due to the logic complicity of it all. Logic can only be reduced so far before you lose the functionality and I have been using my own functions to REUSE routines to try to make it manageable.

Right now I am able to program and debug the program, but its an annoyance more than anything else to have a 5 second pause when I am use to programming quickly as its brain dumping from my brain through my fingers to the IDE.

The system I am using Bloodshed Dev C++ on is a modern 3.4Ghz Core i3 with 4GB RAM running Windows 7 Home Premium fully patched. So it has plenty of processing power and resources. No other programs act up on the system and it otherwise runs healthy. I know that Bloodshed Dev C++ is an old IDE, and maybe there is a better Free one out there if no one knows of a fix for this lag issue every time I edit a line.Can you not break into smaller chunks?You could disable syntax highlighting or autocomplete features. These would require static analysis of the source file which would need to be redone every time the source file changes.

Quote from: DaveLembke on September 21, 2015, 11:58:07 AM

Unfortunately there is no way to reduce the size of the program due to the logic complicity of it all.

I cannot see the code. I can only go off of what you have shared.

If you really have a irreducibly complex, 24,947 line program, It could be the subject of a thesis.

More likely is that it is quite reducible. The use of Copy paste during construction seems to make that clear.Quote
You could disable syntax highlighting or autocomplete features. These would require static analysis of the source file which would need to be redone every time the source file changes.

Thanks BC I will check into disabling these features.

Program is pretty much playing with crypto for fun and a use to keep passwords and private data safe.

I have a small notebook at home that I made a copy of and use to keep a copy of it in trunk of car in case home ever had a fire etc, I'd still have my many user/password and security questions available to me. However like a diary anyone getting their hands on it has EVERYTHING at their FINGERTIPS. However what looks like pages of random characters if worthless to anyone without the program to decrypt it.

I wrote a simple C++ program a while back that looked like an innocent game, but with the correct input it gave access to all my user/password and security info for all the many websites I belong to etc, BUT I dont like having an EXE with this data on a thumb drive that could get lost and someone could say why is this simple game so large in size and decompile to gain access to the private info.

So I decided to crypt my information in a book which is worthless without the correct key and program that spits out the correct information. The book alone is garble to anyone if anyone got a hold of it as well as the program is a simple tool that asks for each character and spits out an output for each character based on the key and character location in what is being decrypted. There might be crypto tools already out there, but decided to make my own and go complex with it and use switch and case statements in which each switch function is a separate key value with different combinations of output for upper/lower case letters, numbers, special characters, and spaces.

Going with a mathematical crypto solution I didnt like because the world of computing is full of patterns, so while I do not have every combination possible in my crypto, I have ENOUGH of them that without the program, key, and book of what to enter into the crypto decryptor its pretty much worthless information for anyone that gets their hands on it. So thats why it has this many lines of code.

If someone was to go with a mathematical crypto, you would just reference an array with all the characters to be used, but for the fact that I am using switch statements its large.

Random Generators for anyone who has worked with them are flawed, and your best option to get rid of predictability is to seed the timer. But you dont want to seed a random generator if you want to place piece of data in and get an output that you can then take that output and put it back in to get the original data as for the seeded timer if not executed at the same time interval at the same location in the algorithm cycle you end up with garbage as the output.

If you really need a better random generator, you can find one.
http://www.rambus.com/intel-random-number-generator/
Quote
Good cryptography requires good random numbers. This paper evaluates the hardwarebased Intel Random Number Generator (RNG) for use in cryptographic applications.
It uses the Johnson ThermalNoise Source
https://en.wikipedia.org/wiki/Johnson%E2%80%93Nyquist_noise
Quote
Thermal noise in an ideal resistor is approximately white, meaning that the power spectral density is nearly constant throughout the frequency spectrum (however see the section below on extremely high frequencies). When limited to a finite bandwidth, thermal noise has a nearly Gaussian amplitude distribution.[
Search for Gaussian amplitude distribution


Discussion

No Comment Found