Hi all, for a long time I've been avoiding forums because most of the things are already solved :) But now I am stuck. I made an application. It consists of simple animation and reading/writing to DB. I run it on xUbuntu with java6, apache and mysql (from repos) I read status from DB every 5 - 10 sec and write ... |
/** * * @param textData text where the words will be replaced * @param designations List |
I am using hibernate DAO insert to commit the insertion, prepared statement is my last resolve because I would very much like to see how to use DAO insert to improve the performance, lol. Sorry for my stuborn. I open connection before insertion and close connection after insert all. I cannot use the method of open and close transaction for each ... |
|
Hi guys, I am using NetBeans for development, i have a combo box for which i am populating data from code, where it will fetch data from a sql table and add it via code and display in my UI, but this process is taking very long time to show values. How can i increase performance so that it displays values ... |
Hi, The piece of code marked bold iterate 2000 times due the result set in table and as result the CPU utilization is hitting 100% for a 2 GB RAM Server with 4 GHZ processor. public List retrieveCustomersForSearch() throws Exception{ List customers = null; Session session = null; CustomerBean customerBean = null; Object[] resultArray = null; try { session = HibernateUtil.currentSession(); ... |
Hi Friends, I have one more problem with JWS.We are launching our AWT/Swing application using JWS but downloading process is very slow. We are using one JNLP file including the reference of multiple jar file So its taking more time in download..........my point of view. Pls give ur suggestion what should I do to improve the JWS performance. -Dinesh |
|
|
I think it just makes it harder for compiling if your not using at least the majority of the names in there, but it will save you time typing and make your source code easier to read. I don't believe it hurts the performance of the byte code because it is just a shortcut for the names for your compiler to ... |
Main purpose of Scanner class is to facilitate "easy programming" when a structured text file (such as CSV, or file with predefined tags/keywords) is to be read. Usage of Scanner is very straight forward and makes your program less cluttered. You can always write better performing custom scanner for you leveraging on special nature of your text data - which is ... |
|
|
|
i am making a web-application where performance is the most important factor. i would like to know if i make a complete web-application with static methods(except for the initial servlet).Which means in effect, the application would be like a C app altogether? i would have no class level variables so no state maintenance required. All methods would take all required variables ... |
|
Does it matter for Java if I put the whole object in my request scope but I do not access those methods like deleteUser, editUser, etc.? For example: In the JSP page i get this object out of the request, i only use the getUser() method, does Java initialise all the other methods? If it does have an impact on the ... |
I am using eclipse IDE . I don't know why but since yesterday whenever I open eclipse ,I'm getting everything undesired . Programs are not being compiled. If they're compiled ,they take a long time to do that . Even my computer becomes slow .After closing the IDE ,everything returns back to normal. I need to know a way. Anyone? I ... |
Dear team, how I can know when a java application is 'faster'? I mean, is better to use arrays or not? Is better to use bytes than integers?etc etc... Do you know any software that it can show me when my program uses low memory, or something that can help me?? Best wishes! |
Hello, I have been going through the turorial, and was running a simply copy appliction CopyCharacters, and noticed that it takes considerably longer to run than just running cp on the command line. For a 20 MB file: cp < 1 second java CopyCharacters 30 - 40 seconds I can't believe that there is such a difference in performance, and I ... |
I have an application, which makes some queries to embedded firebird database bundled with application. When I start this application in IDE (or as standalone jar), fans on my laptop start spinning, while the application is loading initially (this is the time, when the application makes database queries). I think, this spinning is caused due to the fact, application is not ... |
I was trying to make a small GUI quiz , anyway my question is related to a performance question: Task:The program should read a list of strings related to some topic from a local file such that each topic is associated with a specific local file My question is that there are many ways to do this , which is better ... |
The code works at between 2500 and 3500 records per second (Avg is around 3000), it stays at a relatively constant speed for the first 700,000 records ten speed drops slightly. Once the code has processed around 800,000 records it suddenly drops down to 1000 records in 39 seconds. This is wierd and I do not understand why because if ... |
Ignoring operating system performance is a bad idea in this case as some OS are simply better at one thing than others (faster file access, better memory management, better network stack), so those will definitely influence any program running on those OS (not just Java programms), unless your application is entirely CPU bound (in which case there will be little difference). ... |
JNLP ClassLoader performance degraded in 1.6 significantly. We have measured the performance in comparison to former JRE versions, which shows a significant performance problem JAR Type Java PlugIn Appletload-time OriginalSize(13.7MB) 1.5.0_05 17:00 OriginalSize(13.7MB) 1.6.0_03 25:00 OriginalSize(13.7MB) 1.6.0_07 25:00 OriginalSize(13.7MB) 1.6.0_10 24:00 Please give a suggestion that how to improve performance of the application. |
learnerpuneet wrote: given a program written in oop such as java and any other language which is procedure oriented such as c,which will execute faster? and why? There's an overhead in using OO language mechanisms (maybe 10%), but on the other hand you're likely to be doing something similar to get the job done in a non-OO languages so it tends ... |
|
I assume you mean, what determines whether an object is in the L1 cache, L2 cache, L3 cache, main memory or on disk? The CPU and OS do this. iT is not something you can control in Java. Is there a more specific problem you are trying to solve or is this a general question? |
Before you start "fixing" things, I suggest you profile you application first. This means you will be fixing the areas which make a difference. i.e. 90%+ of your code isn't run often enough to matter so don't worry about it. BTW: The profiler will often pick up things you would never have thought of, even if you have ten years experience ... |
I understand the print line is expensive, which make the variable declaration not that expensive. But this is just an example I made up, my real code doesn't have print line. The actual question is if I declare variable inside loop, does java create a variable as many times as loop goes, which makes runtime slow. |
Hi, here is my situation. There is a csv data file which is very huge and about 700 megabytes(10 of millions lines). I need to parse this file into java collection object to store these objects(one line per object). For the application lifetime I have to deal with this collection data, so I am not able to release these memory. I ... |
@Melanie_Green, The scenario I described is rather hypothetical, but thank you nevertheless for your suggestion. Since I said it is a constant, it would make sense to do that, in fact I could decide how much to add, including a possibly negative value. I guess my real question is, will the compiler optimize the condition check out when it realizes the ... |
Hi folks, We have a web application developed using liferay and j2ee technologies.We found certain certain performance during load test.When we executed load tests in some of the areas of our application we found CPU goes upto 1GB.When i analysed the heap dumps taken during the load tests , it shows that nearly 500MB accupeid by the objects which are in ... |
Performance-wise, there's no difference, assuming that method call is literally just an accessor. Well, you save a whopping one method call in the first, and the allocation of a reference in second, but you won't notice the difference either way. If the cancellationNumber isn't used elsewhere in that method, chances are something - the compiler, HotSpot - will optimise the first ... |
Hello All, I am using UUID.randomUUID(); in Java 5 to generate a UUID, when running locally in unit tests run from maven this call takes 250ms, when we run this on our Bamboo server - same maven build - this sometimes takes 136594ms ! , and on some builds (only a few) it will run very quickly. The bamboo build server ... |
Okay, so now that you've got that off your chest, do you feel better? I fail to see the point of your post. So Java's not sufficient for your rather weird needs. Okay, so be it. It's not intended to be everything to everybody. So you can either use something else, or you can change your code to work around this ... |
The particular method stated for one option and 80k simulations would take around 3.46 seconds. So you can well imagine how things add up. these numbers are nto acceptable at all but a compromise on the accuracy of the whole calculation is also not acceptable so reducing the simulations would not be an option. What else would you suggest could be ... |
Java_Cup wrote: so which is faster from performnace point of view? As I have read some white papers and books, but some says the local variables (insode loops) are better as GC will deallocate those variables after loop. If they said that, then they were worthless. GC doesn't touch local variables. And if it did, it would be slower, because you'd ... |
Hi, Is there a known issue related to the scaling of socketWrite in a multi-socket multi-thread environment? We are having an application which makes n separate connections to a database server and use them to insert huge amount of data using the jdbc interface. We are analyzing the performance of the operation if more threads are introduced and data divided among ... |
First, what makes you think the bottleneck is with Scanner, as opposed to say the file I/O or the cache operations? Also, why are you creating a new Scanner for every line. That could cause a bit of a performance hit (but you'll have to profile to find out where the real bottleneck is), and it doesn't make sense to do ... |
|
Hi I am working on a module where I have to upload a file of 80,000 records, process them and then upload them in Web Service. I am uploading file by simply parsing request items = upload.parseRequest(request); After this I am traversing entire file line by line, processing individual records with my logic, and then saving them to a Vector. In ... |
Hi, I have written an java application. This app makes a large number of calls on a method getting a value from an array. Profling the app reveals that it spends more than 90% of the time in this call. Because the app makes so many calls to this method the app isnt running as fast as it should!!! Can someone ... |
|
Hello all, I have an issue where the time the a snippet of code takes to process 2000 records is 33 seconds. This needs to be reduced to may be 2 seconds or very less than 33 seconds. Also, if the number of records are too high instead of 2000 then processing time is increasing exponentially, so for example for 4,000 ... |
hai , I have a doubt. I am doing small project. I have a large database in sql server. I have customer table which contains around million records. Customer table has 15 colums namely account_type,customer_id, Acctount_id etc. In my java program I have to get all records based on account type. For ex if account type is "savings", I have to ... |
Hello Everyone. I am developing a web application using GWT with hibernate. But i found there is huge performance issue. When i searched on GWT forms then i found there everybody gives the one and only solution is that Hibernate4GWT/HIbernate5GWT. But i am trying to explore it with its example and source code then i found there may be nothing whatever ... |
Dont worry, this isnt really about comparing the execution speed of Java to C++. Done this already and java performed better than C++ in most test i carried out. In my report now, i have gotten to my section called Implications of the study. I am trying to write down reasons why comparing the two is a pretty stupid thing to ... |
I know i have brought this topic up before, and it brought many interesting and useful answers. Anyways, I have performed all my test and in the most part Java outperformed c++ by quite alot. One test read in the whole bible, sorted it, and then rewrote it. Java took 343 ms and c++ took 2044 ms. Anyways, the results were ... |
I am trying to implement a simulation framework for my thesis project, and one important requirement is that the framework needs to be quite fast. I was discussing this issue with my thesis coordinator and he had the idea of code generation (for arithmetic expressions, instead of parsing and evaluating a string). |
Hi everyone, I've been struggling with this problem for a few days now and would be glad if you could help. I'm working on a neural networks project. I've written a GUI to edit and train neural networks for a certain task. In order to be able to play with the network architecture in a flexible manner I've exploited the OOP ... |
I require to invoke command line arguments for GnuPG Encryption/Decryption and this has to be done simultaneously for multiple documents in Threads. There could be around 100 Documents everyday for Encryption/Decryption. Will it hit on the performance if I use around 50 - 100 invocations of Runtime.getRuntime.exec() everyday? Edited by: JAVA_Forum_Tanu on Feb 17, 2009 9:03 AM |
|
I need to indentify bottlenecks in a jboss web application -- specifically to be able to track how long each java method takes to execute -- and then to easily be able to view the results. (Results could also be in XML or JSON format, which could be readily viewed with an XML or JSON editor). Some other requirements are that ... |
hello all, i have a question about timers. I have been reading about the poor resolution of System.currentTimeMillis() across different OS's, i starting to consider using the System.nanoTime() counter, then i encountered the many problems that proscess has, including the inability to handle multi-core/multi-processor machines. I want to use a reliable timer, which is documented, has a high resolution and is ... |
Part of answer. Would be to use System.nanoTime() and record difference from start/finish. You could use filters/interceptors if this is web based to avoid doing this on all methods. Otherwise you are probably going to run code through some sort of profiling tool like jProbe. I haven't played around with it, but maybe JConsole can also give you what you want. ... |
Dear all, I am writing an application to process the attendance of Student batches. Each batch is of 60 Students. To retrieve attendance of each batch after all calculations, takes 10 minutes. The business logic to retrieve the attendance details of each batch is same. At present it's taking 1 hour to process 6 batches. I want to reduce the time ... |
My project's JDK upgrades from 1.4 to 5.0. As the programs are still in the 1.4 standard, lots of warnings appears such as variables define... It makes my project's performance very bad. With 1.4, my project can complete processing in 15 minutes, but now it needs over 20 minuts with jdk5.0. When I use @suppress warning to ignore those wranings, the ... |
|
Hi Guys, Thanks for the help to make my applications work. I've written a program using MDB to listen to a queue. This program listens to a given queue. Gets the message from it and routes to different queues based on the certain details inside the message. I've used only MQEnvironment variables, queuemanager and queue to put the message. I have ... |
This is what i got so far: /* * StudentGrade.java * * Created on 26 September 2008, 13:56 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ /** ... |
If each thread is busy doing work, and you don't have seperate processor(s) to run the other thread(s) on, then throwing more threads at it isn't going to help anything. In fact, it'll just be worse of course, because the processor will spend time swapping between threads as well as the real work it needs to do. |
i have a some 'decision' object which has only one method takeDecision that takes a string (an expression basically) as a parameter and does some computing and returns the boolean value. Now this decision object is going to be used by multiple entities and performance is an imp criteria. Now should i have a takeDecision as a static method in my ... |
What I would do with that append() method would be to remove it from the API entirely. The class is supposed to be immutable? Then it doesn't need an append() method. Unless, of course, the append() method isn't meant to change the state of the object, which seems a bit, let's say, unintuitive. Returning a copy of the list with the ... |
I have three classes A, B and X. Both A and B use X but they use different methods so I defined two interfaces for X: XA and XB. This works fine but is not really necessary - so my question is does this affect performance in any way or is it just a compile time thing? Thank you |
Hi Folks, I have a question on .mark and .reset methods in ByteArrayInputStream. I am getting a huge XML as response from server as InputStream and which I have use for processing. I am converting it to a ByteArrayInputStream and processing it as chunks, while starting processing of each chunk I am setting the .reset and end of every chunk I ... |
Hi, I have an arraylist which is return by web services. The size of the arraylist should be minimum of 500. We need to do some sorting based on some values in the arraylist. As of now, we iterate the arraylist and built a VO(Value Object) object and keep it in Map for further processing. The VO contains 5 values. We ... |
Accessing a member variable directly will be a tiny bit faster than through a method, in theory. But you won't notice the difference (no, you won't) and you're better off writing the code without worrying about little micro-optimizations like that edit: can I just say, you've asked your question rather well. Very concise, and you posted just enough code to convey ... |
I understand that for corporate projects there are always requirements like roughy how long it can take for certain process. Is there any rough guideline as how much time certain process will take? And is there anyway i can have something like JMeter that will do constant monitor of the performance as i start development? Can go down to method level, ... |
Dear all, I'm writing a game where user defined Artificial Intelligence (AI) modules control ragdolls, which kill each other with swords. Each AI module controls say 100 or 200 ragdolls, and these AI modules compete with each other; all ragdolls controlled by one AI module are in the same team. The ragdolls controlled by one AI module are not supposed to ... |
Hi We have a java application built with Swing applet and Servlet running on Tomcat. Some other features are: it uses Struts and log4j, and ANT for compilation. How can the application be optimized for better performance. The current application is running fine. But I still think there could be areas of improvement. Areas where compilation process can be improved, memory ... |
Hey all. I was wondering if anyone could shed some light on a recommended buffer size for unzipping a 400 MB file that, when uncompressed, results in 26 GB of files. I read that the buffer should be as large as the file to be unzipped. Can anyone shed some light? Thanks much. - Chris |
I have a few methods and I want to integrate a custom timer class which will measure the time taken for the method to execute. basically the timer class just starts the time at the start of the method and once the method completes it subtract the final time from the start time to give me total time spent in this ... |
|
Hi, I am rephrasing my earlier post like this: As we upgrade to Java 1.5, we would like to tune the application based on the java 1.5 to improve the productivity of the application. Can you please point me to any resources/ links that explain the performance tuning for Java 1.5 Thanks Aishu |
I am getting really poor performance on returning a resultset from an oracle database with JDBC. We've tested the queries on the database side and they are lightning fast. I've tried messing with the fetchsize but nothing I do improves performance. The process is fairly simple. I am calling a remote procedure: CallableStatement callStmt = conn.prepareCall(query); callStmt.registerOutParameter(1, OracleTypes.CURSOR); callStmt.setString (2, id); ... |
|
Well I have a server running on a dedicated server, but im not getting the full output I can get from it. It is a duel core (2 CPU's) but the server only runs at 50% and stops. Im expecting theres a problem with the CPU's and the server can only use 1 at a time. Dose anyone have a solution ... |
If we create a vector inside a class and if that vector is not used anywhere, does it make any difference in performance if I remove that vector? My assumption is that, compilation will be a bit faster if I remove that vector. But runtime performance will be one and the same, if that vector is there or not there. Am ... |
I am writing a pattern matcher, which is complete, and constantly test for speed. One of the experiments was to make the classes final. Surprise surprise, about 5% slower. I have seen that before but never gave it much attention. Making the methods final, on the other hand, makes no different. Time is the same. This is with Sun JVM 1.5. ... |
|
|
About a year ago I made a game for a school project. Some time ago a guy who is taking the same class this year asked me if he could see the final result. Unfortunately he couldn't run the game, as he uses a Mac (which still doesn't have Java 6). So I thought I'd just compile against Java 5 and ... |
I need to work out the efficiency of a program written in Java. Ive used methods before that simply time a procedure and return how many milliseconds it took. This time ive been asked to calculate the performance in megaflops. Is this possible since flops is a measure of how many operations per second are performed? |
|
The compile time for a Java file depends on its size and the size of any other Java files whose compilation is implied by compiling it. What size file(s) did you have in mind? I've never found Java compile time to be much of an issue since about May 1997, why worry? BufferedInputStream reads bytes faster than BufferedReader reads characters,because it ... |
|
I have a java server talking to java and C++ clients using CORBA and moved from java 1.4.2 to 1.6. Using java 1.4.2 for a large block of data, the client consistently refreshes in about 28-32 seconds. Using Java 1.6 the times vary between 19 and 135 seconds. After restarting the server all clients consistently take a simlar amount of time ... |
|
I have 2 Excel files to compare, both files have about 40,000 rows and 34 columns, I have to pick up about 10 values from each row and compare. I sort the entries and run the code, what happens is upto about 15,000 entries performance is good, but it slows down dramatically once the number reaches 17,000 and it takes for ... |
|
/** Sample email template To, The System Administrator, XYZ Corp,UK Respeted Sir, I'm $NAME$ bearing employeeid $EMPID$. Sir please checkout the below description of an ongoing issue. EMPID : $EMPID$ NAME : $NAME$ EMAIL : $EMAIL$ DATAPORT : $DATAPORT$ VOICEPORT : $VOICEPORT$ ISSUE : $ISSUE$ ERROR MESSAGE : $ERROR$ awating for your response Thanking You !!! Best Regards, --------------- $NAME$ **/ ... |
|
Hi All I've been experimenting with Deflater and Inflater since I have an app that needs to read transmitted data and also publish data for transmission. I'm finding that, despite trying various compression options, my app will take around 25ms on average to inflate compressed data. Does anyone have any tips in general for how I can make this faster? I've ... |
|
Hi, I have created Desktop GUI application using Swings. It is basically Indexing and Searching. But sometime the application gets hang. It is also using 85 to 90 % of cpu and more than 100 Mb of memory. I Already optimized my code with Jprofiler. but still it didn't help me enough. How can we handle such of problems ? Thanks ... |
I believe ++i could be a teeny tiny bit faster because you don't have to temporarily store the current alue of i. Good luck creating realistic code where the difference is noticeable though. You don't pick ++i vs. i++ for performance reasons. You pick the one whose semantics best fits your needs. |
Hi, I have a inner class, but does not use its embedded reference to the object which created it. Can somone explain this sentence?? This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made static. Thanks in advance. Deepak |
So if I got around ~1500+ keywords and sentences in the file it won't make a notable differnce if i split that up into multiple files? I assume the webserver caches it, so the amount of users will not matter that much. I'll create it with 1 big file first, and see if it is of any use to split it ... |
Hi all, I run into a java i/o performance everytime I do this: File myfolder = "S:\\remote "; File[] manyFiles = myFolder.listFile(); for(int i=0; i |
Both will execute in a fraction of a second. I doubt very much that worrying about which has a better performance is of any concern. If you write code, it works and doesn't take six hours to execute, then use it. When your code has an awful lag then you can start worrying about performance hits. |