Profiling

Table of Content

What is Profiling

Profiling is analysis and measuring for example the memory or time complexity of a program, the usage of particular instructions, or frequency and duration of function calls. The most common use of profiling information is to aid program optimization.

Sounds troublesome, why doing it?

Often Modders don't have time to test their application as extensivly or have the possibilities to do. Unexpected behaviours can occur because of special mod compositions or configs, the server chose.

By profiling your data and sharing it with the modder, he can pinpoint possible problems within his code and thus help him make a better and more lag-free Mod.

Nice! I want to help, what do I need?

To profile you need a profiler (dun dun). There are some mods out there which help you like TickProfiler but they only indicate problems, but do not deliver extensive information for the modder himself. The tool generally used to profile Java Applications is JVisualVM.

When to profile?

When you notice your TicksPerSeconds (TPS) drop or Lag which is unrelated to your FramePerSecond (FPS) then you can do a profile to see what is the culprit. It is important to profile the moment when it is lagging.

Where do I get it?

Since Java 6 the profiler is part of the Java Development Kit (JDK) and needs it to run. If you have already downloaded and installed the JDK you can continue to the next step.

Open the Oracle Download Page and scroll down to the download links

19 Oct 2013 Oracle JDK 7 Downloadpage

You need to accep the Liencse Agreement to be able to download any file. Choose the JDK needed for your Operating System. Most popular will be Windows, Linux and Mac. x64 indicates that this software is written for 64-Bit CPUs. If you have a 64-Bit processor then download for example the file noted with Windows x64 else choose the Windows x86 for a 32-Bit System. JDK ships with JRE, so by installing the JDK you don't need to install the JRE too. Follow the provided installation instruction by the installer.

Start JVisualVM

Go to your JDK Installation Folder (e.g. C:/Programs/JDK 7) and search for a bin folder. Within this folder you should find a jvisualvm(.exe for Windows). When starting up for the first time you get notified that JVisualVM needs to be calibrated and you should close all performance draining application.

19 Oct 2013 Oracle JDK 7 JVisualVM Calibration Notification

Profiling

  • Open up Minecraft
  • You will notice a new application appeared in your JVisualVM

2013 Oct 23 Minecraft in JVisualVM

  • Double-click to open the minecraft launcher
  • Go to tab Sampler

2013 Oct 23 Sampler Tab

  • Press the CPU button whenever you think you can reproduce the lag spikes and profile it as long as you can. The longer the time you profile the better results can be, because it will contain less fluctuation and abnormalities. You will see some fancy action going on. After some time hit the Snapshot Button. Notice the profile will not stop by snapshotting it.

2013 Oct 23 Snapshot Button

  • In the new opened snapshot tab press the 2. of the 3 Disk Icon labeled with Export to...

2013 Oct 23 Export To Button

  • Choose an appropriate file name and save it to a location of your liking with the extension *.nps. This file can be opened again with JVisualVM so AlgorithmX2 can look at it.

 

Now I have this pretty file, what to do with it?

If you can assure it is AppliedEnergistic related file an issue in our Tracker or send it to AlgorithmX2 in his IRC channel #AppliedEnergistics on Espernet. Please be patient, but I can assure he read every profile so far and it helped improving the mod so far by a great deal.

Links

Page last modified on 10/23/2013 02:08 PM CDT
By thatsIch
Certus Quartz Ore
Unmined certus quartz
Certus Quartz Crystal
Quartz crystal with qualtiies that allow it to store energy.
Certus Quartz Dust
Ground Certus Quartz Crystal
Quartz Grind Stone
Block which when used with a crank, can grind many ores and crystals into dusts.
ME Basic Processor
Crafting ingredient for a large amount of ME Technology.
ME Advanced Processor
Crafting ingredient for a some ME Technology.
Vibration Catalyst
Vibrates the molecules in the targeted block causing it to go though a process similar to smelting.
Entropy Accelerator
Accelerates the ageing and cools of a single block in the world.
ME Wireless Access Terminal
Wireless access terminal for use with wireless access points.
Matter Cannon
A small hand held device which is capable of shooting small nuggets of matter
Quantum Field Ring
Outer blocks of a quantum network bridge, take power and propagate network signal to and from the bridge
Quantum Entangled Singularity
A pair of items which are used to establish a connection between network bridges.
ME Pattern Provider
A part of the MAC multi-block that stored encoded patterns.
ME Crafting CPU
Crafting CPU for use in the MAC Multiblock
ME Heat Vent
Forms the outside walls of the MAC Multiblock
ME Assembler Containment Wall
Containment wall which forms the outside frame of the MAC Multiblock
ME Controller
The controller is the heart of any ME Network, it also accepts power for the network.
ME Drive
Drive which can store up to 10 Storage Cells, and provides their inventory to the network
ME Chest
A simple single storage cell machine which gives direct access to the contents of a single cell, and provides the cells inventory to the network.
ME Access Terminal
Gives full access to the entire content of an ME Network
ME Crafting Terminal
Terminal which also functions as a Crafting table.
ME Crafting Monitor
Displays information about active crafting jobs, and lets you cancel jobs.
ME Cable
Uncolored cable that can connect ME Devices.
ME Import Bus
Imports items into the network, by removing them from the connected inventories
ME Export Bus
Exprots items out of the network, by placing them into connected inventories
ME Level Emitter
Outputs redstone signals depending on the number of a configured item in the network.
ME Storage Bus
Includes an external inventory such as a chest, into the networks storage.
ME Interface
Acts like a small inventory that can import and export to the network, also used in the crafting process.
ME IO Port
Can load and unload storage cells into and out of the network connected.
ME Wireless Access Point
Provides a range of wireless access at the point where the item is placed.
ME Dark Cable
Toggleable cable which can be used to segment your network into diffrent segments to alter functionality or reduce power drain.
ME Storage Monitor
Can be configured to display the number of a specific item that are stored in the network; can also be upgraded to insert / remove that item.
ME Power Relay
Block which accepts power and relays it to attached networks
ME Transition Plane
Surface which converts anything that touches it into energy form
P2P Tunnel
Point 2 Point Tunnel which can be configured to route items/power/liquids from one point to another in a network.
Spatial Pylon
A Marker used to mark a region of space for capture or deploy ment
ME Spatial IO Port
An IO Port used to capture / deploy regions of space defined by pylons.
ME Pattern Encoder
Used to convert blank patterns, into encoded patterns.
ME Partition Editor
Configure Storage cells to hold diffrent types of items and change how your system stores items.
ME Condenser
Condenses items and blocks into raw energy which can be dispersed or converted into a few select items
ME Bus Memory Card
Memory card that can be used to store, and transfer settings