- Mar 8, 2003
- 38,416
- 4
- 0
Originally posted by: amdfanboy
Originally posted by: BlueWeasel
Fixed Link
Thanks. I only edited the text, not the link![]()
Originally posted by: ArmchairAthlete
I had one that was about 500MB. Accidentally coding an infinite loop when writing text to a file = bad. The file is long gone though.
EDIT: It finally stopped when I got an Out of Memory error in Netbeans.
More like a few years; a 30 MB text file has roughly 30000000 characters.Createa file, enter random text, copy and paste a bunch of times, select all and copy again, paste a bunch more times, select all again, etc, repeat... It shouldn't take more than a few minutes.
Originally posted by: BFG10K
More like a few years; a 30 MB text file has roughly 30000000 characters.Createa file, enter random text, copy and paste a bunch of times, select all and copy again, paste a bunch more times, select all again, etc, repeat... It shouldn't take more than a few minutes.
Originally posted by: BFG10K
Plain text?using that method, I made a 46.1MB text file in < 1 minute.
Originally posted by: notfred
Originally posted by: BFG10K
Plain text?using that method, I made a 46.1MB text file in < 1 minute.
Enter 100 characters: 5 seconds.
Ctrl+A = .5 seconds.
Ctrl+C = .5 seconds.
Ctrl+V = .5 seconds.
Ctrl+V 9 more times = 2 seconds.
Total characters at this point: 1,000
Ctrl+A = .5 seconds.
Ctrl+C = .5 seconds.
Ctrl+V = .5 seconds.
Ctrl+V 9 more times = 2 seconds.
Total characters at this point: 10,000
Basically: the size of the file increases by 10x in about 4 seconds.
So, after 8 seconds, you're at 10k. 12 seconds: 100k. 16 seconds: 1mb. 20 seconds: 10 mb. You'll hit 30 mb before the 24 second mark.
Then you can add 5 seconds for the original 100 character entry. Total time: 29 seconds.
Originally posted by: tfinch2
lol...it would take longer to download it than you to create it. it just took me like 45 seconds to create a 81 meg txt file...
Originally posted by: Schadenfroh
Originally posted by: tfinch2
lol...it would take longer to download it than you to create it. it just took me like 45 seconds to create a 81 meg txt file...
i need it to be random and not repeating in ANY pattern or repeating at ANY point, if it repeats itself at anypoint, it will screw up what im planing to do with it.
Originally posted by: Armitage
Just for kicks, here's an example of C++ completely spanking Python.
The python version took about 19 minutes on my system. The C++ version took about 20 seconds!
I like python, but it does have some performance issues. BTW, I did try buffering the data into a 1000 character strings in the python version, rather the writing every character individually. I didn't let it finish, but it didn't have any dramatic impact.
Originally posted by: notfred
Originally posted by: Armitage
Just for kicks, here's an example of C++ completely spanking Python.
The python version took about 19 minutes on my system. The C++ version took about 20 seconds!
I like python, but it does have some performance issues. BTW, I did try buffering the data into a 1000 character strings in the python version, rather the writing every character individually. I didn't let it finish, but it didn't have any dramatic impact.
What machine is that running on?
Here's Perl. It ran in 39 seconds on a P4 1.6Ghz.
Comparable speed to your C++ program (I'd like to hear your processor speed), and more importantly: 5 lines of code. Really only 3 lines if you don't count the shebang and closing bracket.