code: public void stop() {
          MetaClassRegistry registry = GroovySystem.getMetaClassRegistry();
          Set<ProfileMetaClass> proxyMetaClasses = new HashSet(); 
          for (ClassInfo classInfo : ClassInfo.getAllClassInfo()) {
  /* $if version < 2.4 $ */
              Class theClass = classInfo.get();
              MetaClass metaClass = registry.getMetaClass(theClass);
  /* $endif */            
  /* $if version >= 2.4 $ */
              MetaClass metaClass = classInfo.getMetaClass();
  /* $endif */            
              if (metaClass instanceof ProfileMetaClass) {
                  proxyMetaClasses.add((ProfileMetaClass) metaClass);
              }
          }
          
          // resetting the meta class creation handler clears all the meta classes.
          registry.setMetaClassCreationHandle(originalMetaClassCreationHandle);
  
          for (ProfileMetaClass proxyMetaClass : proxyMetaClasses) {
              registry.setMetaClass(proxyMetaClass.getTheClass(), proxyMetaClass.getAdaptee());
          }
      }
docs: Stops profiling.