Results 1 to 3 of 3
- 01-31-2013, 04:55 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 19
- Rep Power
- 0
How to make java not get stuck while performing String operation
Hi,
I am working on a compression class. So far, I can get the program to compress 100 bytes to 44 bytes. However, when I increase the block size, or I mean the amount of data in the buffer, it takes java alot longer to finish the program. Even though the program is running on a thread. Java gets stuck, and I have to wait long before it finish the compression task. Not to mention the same thing, hanging over when performing the decompression task.
Let me put it into perspective: (the numbers are from actual code running in a thread):
Let say compressing 100 bytes takes 609 milliseconds. Not bad, barely a second. However, 200 bytes, takes 1.702 seconds + milliseconds. Thats 1.093 seconds + milliseconds more than the previous 100 byte task. Now with 300 bytes takes 3.415 seconds + milliseconds. Thats again, 1.713 seconds, or 62 milliseconds more than previous 200 bytes task. And Lastly, 400 bytes takes 6.757 seconds + milliseconds, thats 3.342 seconds + milliseconds more, or 1.629 seconds + milliseconds more than the previous 300 byte task.
What I am trying to say, is that the task is taking too long to finish. Is there a way to go around this. I know that threads make things concurrent, but even like this is taking too long.
Help anyone.
I mean the reason the program is taking so long is because it is performing string operations.
Is there a way to make java perform faster under string operation work load?Last edited by ElvisMachuca; 01-31-2013 at 04:58 PM.
- 01-31-2013, 04:59 PM #2
Re: How to make java not get stuck while performing String operation
If you want help, I suggest you provide an SSCCE showing the benchmark you want to improve.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 01-31-2013, 08:58 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
How Can i already be stuck? String play java
By tripline in forum New To JavaReplies: 1Last Post: 10-30-2011, 01:06 AM -
OUt of memery error while using string split operation
By sheetalmuskan in forum New To JavaReplies: 10Last Post: 07-12-2011, 12:36 PM -
Connecting to linux web server and performing command line operations with Java
By Jojomofoman in forum New To JavaReplies: 3Last Post: 01-11-2011, 11:45 PM -
Performing Exponentiation in Java without the Math Class
By BlueJ Coder in forum New To JavaReplies: 9Last Post: 10-14-2009, 08:48 PM -
How to make Java see a string as html
By matpj in forum Java AppletsReplies: 4Last Post: 09-26-2008, 03:40 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks