nWire's blog

Five tips for speeding up Eclipse PDT and nWire

Eclipse Helios (3.6) includes an improved version of Eclipse PDT, labeled 2.2. It is also included in the current Zend Studio (7.1 and above). Among other enhancements, it dramatically improved the performance of code lookup-related tasks like searching references, creating a type hierarchy and even code completion. This is due to a new design, inspired by nWire, which uses the h2 database engine as a persistent storage for this data. 

The h2 database is a high-performance, low profile, Java native database engine, created as a successor to the widely used HSQLDB. It is open source and free to use. nWire uses h2 since its' early days. We gathered a lot of experience on how to optimize h2 and improve its' performance. There's a lot that can be done from the software developer side, however, even as an end user, there's still some simple techniques you can follow to improve the performance on your machine.

The database files

The h2 engine, as it is used in PDT and nWire, is running from within the Eclipse main process (in embedded mode and not as a server) and keeps the information in local storage, i.e. disk files. As a simple analogy, it is a bit like Microsoft Jet database engine used in MS Access. The database files are kept inside the workspace folder. The location of the workspace folder appears in the title of the main Eclipse window.

Under the workspace, there's a special folder called .metadata (beginning with a dot). It may be hidden on your machine. This folder contains settings and temporary files for the workspace. The database files are located in:

  • For PDT: <workspace folder>/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2/
  • For nWire: <workspace folder>/.metadata/.plugins/com.nwiresoftware.nwire.core/ndb/

The database files end with .db suffix. When you work with PDT or nWire, the IO activity around these files is intensive. Keeping the IO smooth is the key to improving your performance. These files can get pretty big. For example, I have a workspace containing the Magento code base with over 5600 PHP files and almost 450K line of code. The PDT repository occupies about 84 MB and the nWire repository is about 1 GB.

1. Disable virus scanners

The first thing you should do is disable virus scanning on database files. This has a major performance impact. The database engine will never execute code stored within the database, so there's no danger of malicious code being executed. Most virus scanners allow disabling the scan of a given folder (see the folders above) or a given suffix (the .db suffix).  

2. Use a fast storage device

Some people use a USB flash drive to store their workspace. Some store their workspace on a network drive. The impact on your performance in these cases will be substantial. If you want to achieve optimal performance, store your workspace on a fast storage device with a fast interface. Use your internal HDD (or SSD) for that purpose. Make sure the drive is properly maintained and has some free space available for the database to grow. If the file system requires it (FAT and NTFS), make sure to defragment your disk periodically.

3. Keep your JVM up to date

Keeping an updated JVM can improve the performance of h2. Especially if your are using an "ancient" version. 

4. Delete the database if your experience problems

In some cases, the database may get corrupted. This can happen, for example, in case of a power failure or a crash. When h2 loads the database, it will try to fix the corrupted data, which may take some time, depending on the database size. In case of PDT and nWire, the data is not really worth saving: it can be recreated by analyzing your source code. This means, you can safely delete the database files. Use this technique if Eclipse hangs when starting up or loading nWire. Make sure you close Eclipse first. The database will be recreated when you restart Eclipse.

5. Do not backup the database

If you are using an automated backup solution (e.g. TimeMachine, or a remote backup software), make sure to exclude the database folders from the backup.  These files are big and they will change frequently, which means it is a lot of data to back up. As I mentioned above, it is really unnecessary, since the data can be recreated. Needless to say, running the backup while working in Eclipse will seriously affect the IO performance.

Conclusion

Use the above tips to keep PDT and nWire running smoothly. If you have more tips or questions, let us know in the comments. For more information on h2 performance see this page

nWire Software joins the Eclipse foundation

Today we have a big announcement: nWire Software joins the Eclipse foundation. You can read the full press release here. This is our way of showing commitment and support to the Eclipse community. We have been active members of the community for a long time and we are very pleased to finally make this step.

eclipse-marketplace-client.png

There are benefits for our users as well. First, we will be mirroring full Eclipse downloads on our site. The downloads are served using a very fast CDN based on Limelight infrastructure. Try it yourself, it is FAST. We are hosting all the popular downloads for Helios (Eclipse 3.6) and Galileo (Eclipse 3.5). Plus, you can choose to add nWire to the prepackaged download. This will save you the trouble of installing nWire later.

But that’s not all. Helios has a new snazzy Eclipse Marketplace client. It makes finding plugins and installing them so much easier. Now that we are Eclipse members, you can find and install nWire directly from the Eclipse Market place dialog box. It is simple and works great. To get started, select Help → Eclipse Marketplace...

nWire and Aptana Studio

Aptana

Aptana Studio is one of the most popular tools for web development. It is Eclipse based and includes support for PHP. Many developers ask: Does nWire support Aptana? Well, I'm afraid the answer just got a bit more complex.

To understand the answer, one needs to be familiar with the state of PHP in Eclipse. Eclipse is an open source community. The Eclipse Platform houses many projects under its' roof. It endorses the development of external plugins and tools, some open source and some proprietary. As an example, Java development is supported by a very strong project called JDT (Java Development Tools). It is one of the first projects and a lot of person years were invested in it.

PHP development is supported by PDT (PHP Development Tools). However, unlike in the Java case, high quality PHP development tools arrived late to the Eclipse party. This opened the door for a number of PHP plugins which were developed outside the Eclipse foundation over the years. Once PDT proved to be a quality contender, most of these projects were abandoned. nWire for PHP was developed for PDT 2.1 and above with support from the PDT team. Thus, it requires the use of the official Eclipse PHP support, which is PDT.

Aptana Studio is an open source IDE based on Eclipse. It borrows some plugins from Eclipse and adds some of its' own. Version 1 of Aptana did not include PDT, but rather a different plugin known as Aptana PHP. In version 2, Aptana Studio moved to PDT, abandoning the previously developed PHP support (see the Aptana Studio 2 release notes). Users of Aptana Studio 2, which is based on PDT, can use nWire with Aptana Studio.

A couple of weeks ago, a beta version of Aptana Studio 3 was released. In this version, PDT is no longer a part of the distribution and, instead, there's a newly developed PHP editor (see the release notes). This means that the new release is incompatible with nWire for PHP, which requires PDT. Users of Aptana Studio 3 cannot use nWire at the moment.

Is this the final verdict? Probably not. Users of Aptana might still be able to use nWire in the future. It should be possible to add PDT to Aptana Studio 3 and use it instead of the Aptana developed PHP support. This will re-enable nWire. However, at the time of this writing, early beta users are reporting issues with the installation of PDT with Aptana. We hope these issues are resolved before the final release.

Finally, we are considering support for Aptana PHP (and perhaps even Ruby) in future nWire releases. If this is something which you'd be interested to see, please chime in and vote in our poll.

nWire Offers Educational Discounts

Helios

nWire is a very useful tool for diving into unfamiliar code. This means it is an excellent companion for students learning how to program. We received numerous requests from students and professors to provide a discount to educational institutions. Today, we are pleased to announce our Educational Discount Program.

The offer is simple: students, faculty, staff and employees of accredited non-profit educational institutions can now purchase a fully functional 1 year nWire license for $19 (Java or PHP, $29 for both). That's more than 75% off the original price.

The educational discount licenses will expire after 1 year. We decided to provide a more substantial discount for a limited time license. Most students will need these tools in their more advanced years of study, so this should not be a problem. It is important to note that the licenses are intended for learning and teaching and should not be used for commercial purposes.

If you qualify for an educational discount license, you can buy yours today. Start from our Educational Discount Store. From there, follow the instructions. You will need to fill out an order form with your details. Make sure you correctly fill the institution details. The provided email address must belong to the domain of your institution. The details will go through our manual review and once the order is cleared (usually less than a day), you will receive an email with payment instructions.

We will also be offering site licenses to educational institutions who wish to install nWire in their labs. If you represent such an institution, please contact our sales for more details.

Finally, if you have any feedback regarding the program, please do not hesitate to contact us. We are considering this program "an experiment", so your feedback is very important to us.

Getting Ready for Helios

Helios

June is a festive month for the Eclipse community: the release of a new version. This year, the new version is called Eclipse Helios or Eclipse 3.6. nWire 1.3 does not officially support this new release, but we are already using it successfully in our labs. It should work just fine, so we invite you to try and report any issues you encounter. Official nWire supports Eclipse 3.6 will be released in the upcoming weeks.

For those not familiar with the Eclipse release cycles, here's a brief introduction. The Eclipse that you download from Eclipse.org is actually a collection of many projects. These include the platform itself, JDT (Java Development Tools), PDT (PHP Development Tools), WebTools and many others. Each year, there's a single release for all these projects. It is called a "release train" because it leaves exactly on time. Everybody has to be ready and board the train, otherwise they miss it.

The Helios "Release Candidate" (RC) build can be downloaded today. The final release will be available on June 23rd. If you want to be among the first to download the new release, you might want to join the "Friends of Eclipse" program.

So what's new in this release? Well, official release notes will be available with the release itself. We also recommend reading the articles which are released as part of the traditional Eclipse Blogathon. The changes may not be that obvious, for a number of reasons:

  • Most of the core Eclipse project are mature and fully featured, so the changes are minor.
  • Many changes and additions are behind the scenes, providing richer API for developers who use Eclipse as a base platform.
  • There are new and exciting projects which are now the focus of attention, mainly e4, the next iteration of Eclipse which takes the platform into the browser.

Nevertheless, there's a lot to look forward to. Like in previous releases, I will be posting my "Eclipse Hidden Treasures" article on my personal blog (last year, it won the Blogathon). PHP developers are in for a real treat, as the new PDT 2.2 (part of the Helios release) offers much improved performance and many improvements. nWire for PHP uses PDT, and the performance boost is noticeable. Give it a try, you won't be disappointed.

Syndicate content