`
QiaoDuanni
  • 浏览: 137513 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

log4j 与 logback 性能对比

    博客分类:
  • java
阅读更多
代码来自 : logback performance clarification
机器配置
Win XP SP3
双核 Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz
2GB内存
结果:
引用

###################### loop 10w #########################
Log4j direct debug call: 250
Log4j direct warn call: 44381
Log4j tested (isDebugEnabled) debug call: 17
###############################################
###################### loop 100w # perfiles 500KB 2000files#########################
Log4j direct debug call: 250
Log4j direct warn call: 45664
Log4j tested (isDebugEnabled) debug call: 13
###############################################
######################## loop 100w # perfiles 500KB 2000files#######################
Log4j direct debug call: 239
Log4j direct warn call: 62462
Log4j tested (isDebugEnabled) debug call: 13
###############################################
################### loop 1000000 # perfiles 10MB 2000files############################
Log4j direct debug call: 236
Log4j direct warn call: 44482
Log4j tested (isDebugEnabled) debug call: 13
###############################################
################### loop 1000000 # perfiles 100MB 2000files############################
Log4j direct debug call: 240
Log4j direct warn call: 44305
Log4j tested (isDebugEnabled) debug call: 13
###############################################
################### loop 1000000 # perfiles 200MB 2000files############################
Log4j direct debug call: 236
Log4j direct warn call: 45445
Log4j tested (isDebugEnabled) debug call: 13
###############################################

########################### 异步模式 ########################################
################### loop 100000 #ASYNC 10线程 500KB 2000files############################
Log4j direct debug call: 938
Log4j direct warn call: 623017
Log4j tested (isDebugEnabled) debug call: 12
###############################################
################### loop 100000 #ASYNC 10线程 500KB 2000files############################
Log4j direct debug call: 989
Log4j direct warn call: 636342
Log4j tested (isDebugEnabled) debug call: 12
###############################################
################### loop 100000 #ASYNC 10线程 10MB 2000files############################
Log4j direct debug call: 954
Log4j direct warn call: 498409
Log4j tested (isDebugEnabled) debug call: 12
###############################################
################### loop 100000 #ASYNC 10线程 100MB 2000files############################
Log4j direct debug call: 961
Log4j direct warn call: 517658
Log4j tested (isDebugEnabled) debug call: 12
###############################################
################### loop 100000 #ASYNC 10线程 200MB 2000files############################
Log4j direct debug call: 994
Log4j direct warn call: 521485
Log4j tested (isDebugEnabled) debug call: 11
###############################################



##################### loop 10w ##########################
Logback direct debug call: 224
Logback direct warn call: 10649
Logback tested (isDebugEnabled) debug call: 16
Logback tested (isWarnEnabled) warn call: 10754
Logback parametrized debug call: 25
Logback parametrized warn call: 11544
###############################################
###############################################
Logback direct debug call: 205
Logback direct warn call: 10634
Logback tested (isDebugEnabled) debug call: 12
Logback tested (isWarnEnabled) warn call: 10886
Logback parametrized debug call: 20
Logback parametrized warn call: 11521
###############################################
################## loop 1000000 # perfiles 500KB and zip#############################
Logback direct debug call: 214
Logback direct warn call: 22342
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 11079
Logback parametrized debug call: 22
Logback parametrized warn call: 11959
###############################################
################## loop 1000000 # perfiles 500KB and zip#############################
Logback direct debug call: 203
Logback direct warn call: 10297
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 10585
Logback parametrized debug call: 20
Logback parametrized warn call: 10884
###############################################
################## loop 1000000 # perfiles 200MB and zip#############################
Logback direct debug call: 206
Logback direct warn call: 8472
Logback tested (isDebugEnabled) debug call: 12
Logback tested (isWarnEnabled) warn call: 8600
Logback parametrized debug call: 21
Logback parametrized warn call: 8707
###############################################
################## loop 1000000 # perfiles 100MB and zip#############################
Logback direct debug call: 395
Logback direct warn call: 40629
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 40417
Logback parametrized debug call: 20
Logback parametrized warn call: 40687
Count Times(ms) : 122156
###############################################
################## loop 1000000 # perfiles 100MB and zip#############################
Logback direct debug call: 236
Logback direct warn call: 8489
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 8535
Logback parametrized debug call: 21
Logback parametrized warn call: 9042
###############################################
################## loop 1000000 # perfiles 50MB and zip#############################
Logback direct debug call: 217
Logback direct warn call: 8508
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 8695
Logback parametrized debug call: 20
Logback parametrized warn call: 8757
###############################################
################## loop 1000000 # perfiles 10MB and zip#############################
Logback direct debug call: 208
Logback direct warn call: 8499
Logback tested (isDebugEnabled) debug call: 12
Logback tested (isWarnEnabled) warn call: 8578
Logback parametrized debug call: 22
Logback parametrized warn call: 8741
###############################################
################## loop 100000  # jdbc(c3p0) #############################
Logback direct debug call: 355
Logback direct warn call: 3937399
Logback tested (isDebugEnabled) debug call: 27
Logback tested (isWarnEnabled) warn call: 4040561
Logback parametrized debug call: 40
Logback parametrized warn call: 4004411
###############################################
################## loop 2000000 # 1 Main Thread 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 406
Logback direct warn call: 40168
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 40212
Logback parametrized debug call: 20
Logback parametrized warn call: 40562
Count Times(ms) : 242765
###############################################
################## loop 1000000 # 1 Main Thread 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 389
Logback direct warn call: 39958
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 40440
Logback parametrized debug call: 20
Logback parametrized warn call: 40335
Count Times(ms) : 121156
###############################################
################## loop 1000000 # socket 1 client 1 Main Thread 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 401
Logback direct warn call: 117924
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 118562
Logback parametrized debug call: 19
Logback parametrized warn call: 128202
Count Times(ms) : 365110
###############################################
################## loop 100000 # socket 1 client 1 Main Thread 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 148301
Logback direct warn call: 152806
Logback tested (isDebugEnabled) debug call: 150971
Logback tested (isWarnEnabled) warn call: 141062
Logback parametrized debug call: 158658
Logback parametrized warn call: 153140
Count Times(ms) : 90500
###############################################
################## loop 1000000 # socket 1 client 1 Main Thread 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 388
Logback direct warn call: 144331
Logback tested (isDebugEnabled) debug call: 10
Logback tested (isWarnEnabled) warn call: 96334
Logback parametrized debug call: 20
Logback parametrized warn call: 92826
Count Times(ms) : 333907
###############################################
################## loop 1000000 # socket 1 client 1 Main Thread 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 392
Logback direct warn call: 166776
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 216869
Logback parametrized debug call: 141
Logback parametrized warn call: 156749
Count Times(ms) : 540969
###############################################


################## loop 100000 # 10thread 20queueSize 500KB and zip #per LogSize 286 Byte#############################
Logback direct debug call: 885
Logback direct warn call: 451863
Logback tested (isDebugEnabled) debug call: 9
Logback tested (isWarnEnabled) warn call: 451750
Logback parametrized debug call: 21
Logback parametrized warn call: 449805
###############################################
################## loop 100000 # 10 Thread 20 QueueSize 10MB and zip #per LogSize 286 Byte#############################
Logback direct debug call: 918
Logback direct warn call: 450027
Logback tested (isDebugEnabled) debug call: 9
Logback tested (isWarnEnabled) warn call: 452299
Logback parametrized debug call: 22
Logback parametrized warn call: 437268
###############################################
################## loop 100000 # 10 Thread 20 QueueSize 100MB and zip #per LogSize 286 Byte#############################
Logback direct debug call: 808
Logback direct warn call: 445219
Logback tested (isDebugEnabled) debug call: 10
Logback tested (isWarnEnabled) warn call: 449316
Logback parametrized debug call: 20
Logback parametrized warn call: 431124
###############################################
################## loop 100000 # 10 Thread 20 QueueSize 200MB and zip #per LogSize 286 Byte#############################
Logback direct debug call: 851
Logback direct warn call: 445867
Logback tested (isDebugEnabled) debug call: 10
Logback tested (isWarnEnabled) warn call: 450838
Logback parametrized debug call: 21
Logback parametrized warn call: 440028
###############################################
################## loop 100000 # 50 Thread 50 QueueSize 100MB and zip #per LogSize 286 Byte#############################
Logback direct debug call: 8719
Logback direct warn call: 2358846
Logback tested (isDebugEnabled) debug call: 10
Logback tested (isWarnEnabled) warn call: 2346821
Logback parametrized debug call: 20
Logback parametrized warn call: 2329942
###############################################
################## loop 100000 # 4 Thread 20 QueueSize 100MB and zip #per LogSize 286 Byte#############################
Logback direct debug call: 1299
Logback direct warn call: 195412
Logback tested (isDebugEnabled) debug call: 14
Logback tested (isWarnEnabled) warn call: 194969
Logback parametrized debug call: 24
Logback parametrized warn call: 192029
###############################################
################## loop 100000 # 3 Thread 20 QueueSize 100MB and zip #per LogSize 286 Byte#############################
Logback direct debug call: 915
Logback direct warn call: 145027
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 140793
Logback parametrized debug call: 21
Logback parametrized warn call: 143145
###############################################
################## loop 100000 # 2 Thread 20 QueueSize 100MB and zip  #per LogSize 286 Byte#############################
Logback direct debug call: 961
Logback direct warn call: 95941
Logback tested (isDebugEnabled) debug call: 10
Logback tested (isWarnEnabled) warn call: 96473
Logback parametrized debug call: 20
Logback parametrized warn call: 96345
###############################################
################## loop 100000 # 1 Thread 20 QueueSize 100MB and zip  #per LogSize 286 Byte#############################
Logback direct debug call: 414
Logback direct warn call: 44408
Logback tested (isDebugEnabled) debug call: 9
Logback tested (isWarnEnabled) warn call: 44709
Logback parametrized debug call: 18
Logback parametrized warn call: 45287
###############################################
################## loop 100000 # 1 Thread 20 QueueSize 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 403
Logback direct warn call: 43233
Logback tested (isDebugEnabled) debug call: 10
Logback tested (isWarnEnabled) warn call: 43490
Logback parametrized debug call: 19
Logback parametrized warn call: 43935
Count Times(ms) : 270000
###############################################
################## loop 100000 # 1 Thread 20 QueueSize 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 410
Logback direct warn call: 43172
Logback tested (isDebugEnabled) debug call: 9
Logback tested (isWarnEnabled) warn call: 43314
Logback parametrized debug call: 19
Logback parametrized warn call: 43751
Count Times(ms) : 283812
###############################################
################## loop 100000 # 2 Thread 20 QueueSize 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 511
Logback direct warn call: 92970
Logback tested (isDebugEnabled) debug call: 12
Logback tested (isWarnEnabled) warn call: 90352
Logback parametrized debug call: 20
Logback parametrized warn call: 92044
Count Times(ms) : 304656
###############################################
################## loop 100000 # 3 Thread 20 QueueSize 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 619
Logback direct warn call: 136300
Logback tested (isDebugEnabled) debug call: 10
Logback tested (isWarnEnabled) warn call: 146003
Logback parametrized debug call: 20
Logback parametrized warn call: 109449
Count Times(ms) : 294078
###############################################
################## loop 100000 # 4 Thread 20 QueueSize 100MB #per LogSize 286 Byte#############################
Logback direct debug call: 702
Logback direct warn call: 171259
Logback tested (isDebugEnabled) debug call: 11
Logback tested (isWarnEnabled) warn call: 178437
Logback parametrized debug call: 21
Logback parametrized warn call: 187121
Count Times(ms) : 293609
###############################################


log4j测试代码
/**
 * $Id$
 */
package perfTest.ch.qos.logback;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

/**
 * @author Last changed by: $Author$
 * @version $Revision$ $Date$
 */
public class PerformanceLog4j {
	static Logger log4jlogger = Logger.getLogger(PerformanceLog4j.class);

	// How many times should we try to log:
	static int loop = 1000000;

	public static void main(String[] args) throws InterruptedException {
		initConfig();

		// Let's run once for Just In Time compiler
		log4jDirectDebugCall();
		log4jDirectWarnCall();
		log4jTestedDebugCall();

		// let's run the tests and display the results:
		long result1 = log4jDirectDebugCall();
		long result2 = log4jDirectWarnCall();
		long result3 = log4jTestedDebugCall();

		System.out.println("################### loop " + loop + " ############################");
		System.out.println("Log4j direct debug call: " + result1);
		System.out.println("Log4j direct warn call: " + result2);
		System.out.println("Log4j tested (isDebugEnabled) debug call: " + result3);
		System.out.println("###############################################");
	}

	private static long log4jDirectDebugCall() {
		Integer j = new Integer(1);
		long start = System.nanoTime();
		for (int i = 0; i < loop; i++) {
			log4jlogger.debug("SEE IF THIS IS LOGGED log4jDirectDebugCall() " + j + ".");
		}
		return (System.nanoTime() - start) / loop;
	}

	private static long log4jDirectWarnCall() {
		Integer j = new Integer(2);
		long start = System.nanoTime();
		for (int i = 0; i < loop; i++) {
			log4jlogger.warn("SEE IF THIS IS LOGGED  log4jDirectWarnCall()" + j + ".");
		}
		return (System.nanoTime() - start) / loop;
	}

	private static long log4jTestedDebugCall() {
		Integer j = new Integer(3);
		long start = System.nanoTime();
		for (int i = 0; i < loop; i++) {
			if (log4jlogger.isDebugEnabled()) {
				log4jlogger.debug("SEE IF THIS IS LOGGED log4jTestedDebugCall() " + j + ".");
			}
		}
		return (System.nanoTime() - start) / loop;
	}

	private static void initConfig() {
		DOMConfigurator.configure("src/main/resource/log4j.xml");

		// create the loggers
		org.apache.log4j.Logger.getLogger("perfTest");
		org.apache.log4j.Logger.getLogger("perfTest.ch");
		org.apache.log4j.Logger.getLogger("perfTest.ch.qos");
		org.apache.log4j.Logger.getLogger("perfTest.ch.qos.logback");
	}
}


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>

<!--	<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">-->
<!--		<appender-ref ref="STDOUT" />-->
<!--	</appender>-->

	<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d (%t) [%24F:%-3L:%-5p]%x %m%n" />
		</layout>
	</appender>
	
	<appender name="FILE" class="org.apache.log4j.RollingFileAppender">
		<param name="File" value="logs/log4j-test.log" />
		<param name="BufferSize" value="8129" />
		<param name="Append" value="true" />
		<param name="MaxFileSize" value="200MB"/>
		<param name="MaxBackupIndex" value="2000"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d (%t) [%24F:%-3L:%-5p]%x %m%n" />
		</layout>
	</appender>
	
	
	<root>
		<priority value="INFO" />
<!--		<appender-ref ref="STDOUT" />-->
		 <appender-ref ref="FILE"/> 
	</root>

</log4j:configuration>


logback测试代码
/**
 * $Id$
 */
package perfTest.ch.qos.logback;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.core.joran.spi.JoranException;
import ch.qos.logback.core.util.StatusPrinter;

/**
 * @author Last changed by: $Author$
 * @version $Revision$ $Date$
 */
public class PerformanceLogback {
	static Logger logbacklogger = LoggerFactory.getLogger(PerformanceLogback.class);

	// How many times should we try to log:
	static int loop = 1000000;

	public static void main(String[] args) throws InterruptedException {
		// initConfig();

		// Let's run once for Just In Time compiler
		logbackDirectDebugCall();
		logbackDirectWarnCall();
		logbackTestedDebugCall();
		logbackTestedWarnCall();
		logbackParametrizedDebugCall();
		logbackParametrizedWarnCall();

		// let's run the tests and display the results:
		long result4 = logbackDirectDebugCall();
		long result5 = logbackDirectWarnCall();
		long result6 = logbackTestedDebugCall();
		long result7 = logbackTestedWarnCall();
		long result8 = logbackParametrizedDebugCall();
		long result9 = logbackParametrizedWarnCall();

		System.out.println("################## loop " + loop + " #############################");
		System.out.println("Logback direct debug call: " + result4);
		System.out.println("Logback direct warn call: " + result5);
		System.out.println("Logback tested (isDebugEnabled) debug call: " + result6);
		System.out.println("Logback tested (isWarnEnabled) warn call: " + result7);
		System.out.println("Logback parametrized debug call: " + result8);
		System.out.println("Logback parametrized warn call: " + result9);
		System.out.println("###############################################");
	}

	private static long logbackDirectDebugCall() {
		Integer j = new Integer(5);
		long start = System.nanoTime();
		for (int i = 0; i < loop; i++) {
			logbacklogger.debug("SEE IF THIS IS LOGGED " + j + ".");
		}
		return (System.nanoTime() - start) / loop;
	}

	private static long logbackDirectWarnCall() {
		Integer j = new Integer(6);
		long start = System.nanoTime();
		for (int i = 0; i < loop; i++) {
			logbacklogger.warn("SEE IF THIS IS LOGGED logbackDirectWarnCall()" + j + ".");
		}
		return (System.nanoTime() - start) / loop;
	}

	private static long logbackTestedDebugCall() {
		Integer j = new Integer(7);
		long start = System.nanoTime();
		for (int i = 0; i < loop; i++) {
			if (logbacklogger.isDebugEnabled())
				logbacklogger.debug("SEE IF THIS IS LOGGED " + j + ".");
		}
		return (System.nanoTime() - start) / loop;
	}

	private static long logbackTestedWarnCall() {
		Integer j = new Integer(8);
		long start = System.nanoTime();
		for (int i = 0; i < loop; i++) {
			if (logbacklogger.isWarnEnabled())
				logbacklogger.warn("SEE IF THIS IS LOGGED logbackTestedWarnCall()" + j + ".");
		}
		long end = System.nanoTime();
		long result = (end - start) / loop;
		System.out.println("start = " + start + "end = " + end + "result = " + result);
		return result;
	}

	private static long logbackParametrizedDebugCall() {
		Integer j = new Integer(9);
		long start = System.nanoTime();
		for (int i = 0; i < loop; i++) {
			logbacklogger.debug("SEE IF THIS IS LOGGED {}.", j);
		}
		return (System.nanoTime() - start) / loop;
	}

	private static long logbackParametrizedWarnCall() {
		Integer j = new Integer(10);
		long start = System.nanoTime();
		for (int i = 0; i < loop; i++) {
			logbacklogger.warn("SEE IF THIS IS LOGGED logbackParametrizedWarnCall() {}.", j);
		}
		long end = System.nanoTime();
		long result = (end - start) / loop;
		System.out.println("start = " + start + "end = " + end + "result = " + result);
		return result;
	}

	private static void initConfig() {
		// assume SLF4J is bound to logback in the current environment
		LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();

		try {
			JoranConfigurator configurator = new JoranConfigurator();
			configurator.setContext(lc);
			// the context was probably already configured by default configuration
			// rules
			lc.reset();
			configurator.doConfigure("src/main/resource/logback.xml");
		} catch (JoranException je) {
			// StatusPrinter will handle this
		}
		StatusPrinter.printInCaseOfErrorsOrWarnings(lc);

		// create the loggers
		LoggerFactory.getLogger("perfTest");
		LoggerFactory.getLogger("perfTest.ch");
		LoggerFactory.getLogger("perfTest.ch.qos");
		LoggerFactory.getLogger("perfTest.ch.qos.logback");
	}
}


<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
	<property file="src/main/resource/jdbc.properties" />

	<appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
		<connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">
			<dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">
				<driverClass>${jdbc.driver.class}</driverClass>
				<jdbcUrl>${jdbc.url}</jdbcUrl>
				<!--				<serverName>${serverName}</serverName>-->
				<!--         <databaseName>${databaseName}</databaseName>-->
				<user>${jdbc.username}</user>
				<password>${jdbc.password}</password>
				<param name="minPoolSize" value="30" />
				<param name="maxPoolSize" value="60" />
				<param name="initialPoolSize" value="30" />
				<param name="acquireIncrement" value="3" />
				<param name="acquireRetryAttempts" value="30" />
				<param name="acquireRetryDelay" value="1000" />
				<param name="autoCommitOnClose" value="false" />
				<param name="breakAfterAcquireFailure" value="false" />
				<param name="checkoutTimeout" value="0" />
				<param name="maxIdleTime" value="60" />
				<param name="maxStatements" value="100" />
			</dataSource>

		</connectionSource>
	</appender>
	<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>logs/logback-test.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<!-- rollover daily -->
			<fileNamePattern>logs/logback-%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
				<!-- or whenever the file size reaches 100MB -->
				<maxFileSize>10MB</maxFileSize>
			</timeBasedFileNamingAndTriggeringPolicy>
		</rollingPolicy>
		<encoder>
			<pattern>%date{ISO8601} [%thread] [%24file:%M:%-3line:%-5level] - %msg%n</pattern>
		</encoder>
	</appender>

	<root level="INFO">
<!--		<appender-ref ref="DB" />-->
		<appender-ref ref="FILE" />
	</root>
</configuration>

jdbc.properties
# mysql config
jdbc.driver.class=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost/logs?autoReconnect=true&useUnicode=true&characterEncoding=utf8
jdbc.username=root
jdbc.password=root


10线程模式
/**
 * $Id$
 */
package perfTest.ch.qos.logback;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

/**
 * @author Last changed by: $Author$
 * @version $Revision$ $Date$
 */
public class PerformanceLog4j {

	// How many times should we try to log:
	static int loop = 100000;

	static ConcurrentMap<Integer, Long> result = new ConcurrentHashMap<Integer, Long>();

	static int RESULT_1 = 1;
	static int RESULT_2 = 2;
	static int RESULT_3 = 3;
	static int countThread = 20;

	public PerformanceLog4j() {

	}

	public void start() {
		initConfig();
		result.put(RESULT_1, 0L);
		result.put(RESULT_2, 0L);
		result.put(RESULT_3, 0L);
		int countT = countThread;
		ExecutorService executor = Executors.newFixedThreadPool(10);

		for (int i = 0; i < countThread; i++) {
			executor.execute(new Log4jRun());
		}

		while (countThread > 0) {
			try {
				Thread.sleep(10000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		executor.shutdown();

		System.out.println("################### loop " + loop + " #ASYNC ############################");
		System.out.println("Log4j direct debug call: " + result.get(RESULT_1) / countT);
		System.out.println("Log4j direct warn call: " + result.get(RESULT_2) / countT);
		System.out.println("Log4j tested (isDebugEnabled) debug call: " + result.get(RESULT_3) / countT);
		System.out.println("###############################################");

	}

	public static void main(String[] args) throws InterruptedException {
		new PerformanceLog4j().start();
	}

	private static void initConfig() {
		DOMConfigurator.configure("src/main/resource/log4j.xml");

		// create the loggers
		org.apache.log4j.Logger.getLogger("perfTest");
		org.apache.log4j.Logger.getLogger("perfTest.ch");
		org.apache.log4j.Logger.getLogger("perfTest.ch.qos");
		org.apache.log4j.Logger.getLogger("perfTest.ch.qos.logback");
	}

	static class Log4jRun implements Runnable {
		static Logger log4jlogger = Logger.getLogger(Log4jRun.class);

		static {
			// Let's run once for Just In Time compiler
			log4jDirectDebugCall();
			log4jDirectWarnCall();
			log4jTestedDebugCall();
		}

		public Log4jRun() {

		}

		/*
		 * (non-Javadoc)
		 * @see java.lang.Runnable#run()
		 */
		@Override
		public void run() {
			System.out.println("start " + Thread.currentThread());
			// let's run the tests and display the results:
			long result1 = log4jDirectDebugCall();
			long result2 = log4jDirectWarnCall();
			long result3 = log4jTestedDebugCall();
			synchronized (result) {
				result.put(RESULT_1, result.get(RESULT_1) + result1);
				result.put(RESULT_2, result.get(RESULT_2) + result2);
				result.put(RESULT_3, result.get(RESULT_3) + result3);
			}
			countThread--;
			System.out.println("count " + countThread + " end " + Thread.currentThread());
		}

		private static long log4jDirectDebugCall() {
			Integer j = new Integer(1);
			long start = System.nanoTime();
			for (int i = 0; i < loop; i++) {
				log4jlogger.debug("SEE IF THIS IS LOGGED log4jDirectDebugCall() " + j + ".");
			}
			return (System.nanoTime() - start) / loop;
		}

		private static long log4jDirectWarnCall() {
			Integer j = new Integer(2);
			long start = System.nanoTime();
			for (int i = 0; i < loop; i++) {
				log4jlogger.warn("SEE IF THIS IS LOGGED  log4jDirectWarnCall()" + j + ".");
			}
			return (System.nanoTime() - start) / loop;
		}

		private static long log4jTestedDebugCall() {
			Integer j = new Integer(3);
			long start = System.nanoTime();
			for (int i = 0; i < loop; i++) {
				if (log4jlogger.isDebugEnabled()) {
					log4jlogger.debug("SEE IF THIS IS LOGGED log4jTestedDebugCall() " + j + ".");
				}
			}
			return (System.nanoTime() - start) / loop;
		}

	}
}


/**
 * $Id$
 */
package perfTest.ch.qos.logback;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Last changed by: $Author$
 * @version $Revision$ $Date$
 */
public class PerformanceLogback {

	// How many times should we try to log:
	static int loop = 100000;

	static ConcurrentMap<Integer, Long> result = new ConcurrentHashMap<Integer, Long>();

	static int RESULT_4 = 1;
	static int RESULT_5 = 2;
	static int RESULT_6 = 3;
	static int RESULT_7 = 4;
	static int RESULT_8 = 5;
	static int RESULT_9 = 6;
	static int countThread = 20;

	public PerformanceLogback() {

	}

	public void start() {
		result.put(RESULT_4, 0L);
		result.put(RESULT_5, 0L);
		result.put(RESULT_6, 0L);
		result.put(RESULT_7, 0L);
		result.put(RESULT_8, 0L);
		result.put(RESULT_9, 0L);

		int countT = countThread;
		ExecutorService executor = Executors.newFixedThreadPool(10);

		for (int i = 0; i < countThread; i++) {
			executor.execute(new LogbackRun());
		}

		while (countThread > 0) {
			try {
				Thread.sleep(10000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		executor.shutdown();

		System.out.println("################## loop " + loop + " #############################");
		System.out.println("Logback direct debug call: " + result.get(RESULT_4) / countT);
		System.out.println("Logback direct warn call: " + result.get(RESULT_5) / countT);
		System.out.println("Logback tested (isDebugEnabled) debug call: " + result.get(RESULT_6) / countT);
		System.out.println("Logback tested (isWarnEnabled) warn call: " + result.get(RESULT_7) / countT);
		System.out.println("Logback parametrized debug call: " + result.get(RESULT_8) / countT);
		System.out.println("Logback parametrized warn call: " + result.get(RESULT_9) / countT);
		System.out.println("###############################################");
	}

	public static void main(String[] args) throws InterruptedException {
		new PerformanceLogback().start();
	}

	static class LogbackRun implements Runnable {
		static Logger logbacklogger = LoggerFactory.getLogger(LogbackRun.class);

		static {
			// Let's run once for Just In Time compiler
			logbackDirectDebugCall();
			logbackDirectWarnCall();
			logbackTestedDebugCall();
			logbackTestedWarnCall();
			logbackParametrizedDebugCall();
			logbackParametrizedWarnCall();
		}
		/*
		 * (non-Javadoc)
		 * @see java.lang.Runnable#run()
		 */
		@Override
		public void run() {
			System.out.println("start " + Thread.currentThread());
			// let's run the tests and display the results:
			long result4 = logbackDirectDebugCall();
			long result5 = logbackDirectWarnCall();
			long result6 = logbackTestedDebugCall();
			long result7 = logbackTestedWarnCall();
			long result8 = logbackParametrizedDebugCall();
			long result9 = logbackParametrizedWarnCall();
			synchronized (result) {
				result.put(RESULT_4, result.get(RESULT_4) + result4);
				result.put(RESULT_5, result.get(RESULT_5) + result5);
				result.put(RESULT_6, result.get(RESULT_6) + result6);
				result.put(RESULT_7, result.get(RESULT_7) + result7);
				result.put(RESULT_8, result.get(RESULT_8) + result8);
				result.put(RESULT_9, result.get(RESULT_9) + result9);
			}
			countThread--;
			System.out.println("count " + countThread + " end " + Thread.currentThread());

		}

		private static long logbackDirectDebugCall() {
			Integer j = new Integer(5);
			long start = System.nanoTime();
			for (int i = 0; i < loop; i++) {
				logbacklogger.debug("SEE IF THIS IS LOGGED " + j + ".");
			}
			return (System.nanoTime() - start) / loop;
		}

		private static long logbackDirectWarnCall() {
			Integer j = new Integer(6);
			long start = System.nanoTime();
			for (int i = 0; i < loop; i++) {
				logbacklogger.warn("SEE IF THIS IS LOGGED logbackDirectWarnCall()" + j + ".");
			}
			return (System.nanoTime() - start) / loop;
		}

		private static long logbackTestedDebugCall() {
			Integer j = new Integer(7);
			long start = System.nanoTime();
			for (int i = 0; i < loop; i++) {
				if (logbacklogger.isDebugEnabled())
					logbacklogger.debug("SEE IF THIS IS LOGGED " + j + ".");
			}
			return (System.nanoTime() - start) / loop;
		}

		private static long logbackTestedWarnCall() {
			Integer j = new Integer(8);
			long start = System.nanoTime();
			for (int i = 0; i < loop; i++) {
				if (logbacklogger.isWarnEnabled())
					logbacklogger.warn("SEE IF THIS IS LOGGED logbackTestedWarnCall()" + j + ".");
			}
			long end = System.nanoTime();
			long result = (end - start) / loop;
			// System.out.println("start = " + start + "end = " + end + "result = " + result);
			return result;
		}

		private static long logbackParametrizedDebugCall() {
			Integer j = new Integer(9);
			long start = System.nanoTime();
			for (int i = 0; i < loop; i++) {
				logbacklogger.debug("SEE IF THIS IS LOGGED {}.", j);
			}
			return (System.nanoTime() - start) / loop;
		}

		private static long logbackParametrizedWarnCall() {
			Integer j = new Integer(10);
			long start = System.nanoTime();
			for (int i = 0; i < loop; i++) {
				logbacklogger.warn("SEE IF THIS IS LOGGED logbackParametrizedWarnCall() {}.", j);
			}
			long end = System.nanoTime();
			long result = (end - start) / loop;
			// System.out.println("start = " + start + "end = " + end + "result = " + result);
			return result;
		}
	}
}

分享到:
评论

相关推荐

    利用Simulink实现混合储能系统在直流微网中的下垂控制策略研究:保持直流母线电压稳定的实践与探究,Simulink仿真下的光储直流微网混合储能系统下垂控制策略优化研究(注意版本要求为2021A以上

    利用Simulink实现混合储能系统在直流微网中的下垂控制策略研究:保持直流母线电压稳定的实践与探究,Simulink仿真下的光储直流微网混合储能系统下垂控制策略优化研究(注意版本要求为2021A以上),混合储能系统 光储微网 下垂控制 Simulink仿真 注意版本2021A以上 由光伏发电系统和混合储能系统构成直流微网。 混合储能系统由超级电容器和蓄电池构成,通过控制混合储能系统来维持直流母线电压稳定。 混合储能系统采用下垂控制来实现超级电容和蓄电池的功率分配,蓄电池响应低频量,超级电容响应高频量。 通过改变光照来影响光伏出力,控制混合储能系统保持微网直流母线电压稳定在380V,不受光伏出力变化影响。 ,混合储能系统; 光储微网; 下垂控制; Simulink仿真; 版本2021A; 直流母线电压稳定; 光伏出力变化; 超级电容器; 蓄电池。,2021A+混合储能系统:光储微网下垂控制Simulink仿真研究

    JavaScript入门到精通: 全栈编程语言的基础与进阶学习指南

    内容概要:本文档是针对JavaScript这一跨平台解释型语言的详尽入门手册,首先概述了JavaScript的概念及其重要特性,强调它不仅适用于前端同时也活跃于Node.js的服务器环境之中,从而成为全栈开发的重要技能。紧接着文档阐述了JavaScript的基本语法元素如变量声明、数据类型、运算符及控制结构,让新手理解JavaScript的语法规则,并通过函数与对象操作加深印象。之后介绍了一些常见的实用工具和高级用法,例如模板字符串、解构赋值以及异步编程手段(比如Promise)。对于想要深入探索的应用场景给出了广泛的指引,无论是传统的web开发还是新兴领域的IoT或自动化脚本编写皆有所涉猎。 适合人群:对于那些没有编程背景或有其他编程经验但仍希望了解并擅长运用JavaScript的个人来说非常适合。 使用场景及目标:目的是向初学者提供足够的理论指导和技术实践机会,使他们能够在不同平台上利用JavaScript创造出有意义的作品;不论是想要从事专业软件开发或是业余项目爱好者都能够从中受益。 其他说明:文档还提供了大量权威且有用的外部链接供进一步深造学习,包括但不限于主流的在线课程、权威的技术参考资料及充满活力的支持社区。

    2D3D 中弗里德里希常数和庞加莱常数的计算 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均

    级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,不平衡电网下的svg无功补偿,级联H桥svg无功补偿statcom,采用三层控制策略。 (1)第一层采用电压电流双闭环pi控制,电压电流正负序分离,电压外环通过产生基波正序有功电流三相所有H桥模块直流侧平均电压恒定,电流内环采用前馈解耦控制; (2)第二层相间电压均衡控制,注入零序电压,控制通过注入零序电压维持相间电压平衡; (3)第三层相内电压均衡控制,使其所有子模块吸收的有功功率与其损耗补,从而保证所有H桥子模块直流侧电压值等于给定值。 有参考资料。 639,核心关键词: 1. 不平衡电网下的SVG无功补偿 2. 级联H桥SVG无功补偿STATCOM 3. 三层控制策略 4. 电压电流双闭环PI控制 5. 电压电流正负序分离 6. 直流侧平均电压恒定 7. 前馈解耦控制 8. 相间电压均衡控制 9. 零序电压注入 10. 相内电压均衡控制 以上十个关键词用分号分隔的格式为:不

    基于时空RBF-NN的混沌时间序列预测 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    基于主从博弈的动态定价策略与电动汽车充电管理优化在智能小区的实践(MATLAB+CPLEX gurobi实现),基于主从博弈理论的智能小区电动汽车充电与代理商动态定价策略优化研究,MATLAB代码:基

    基于主从博弈的动态定价策略与电动汽车充电管理优化在智能小区的实践(MATLAB+CPLEX gurobi实现),基于主从博弈理论的智能小区电动汽车充电与代理商动态定价策略优化研究,MATLAB代码:基于主从博弈的智能小区代理商定价策略及电动汽车充电管理 关键词:电动汽车 主从博弈 动态定价 智能小区 充放电优化 参考文档:《基于主从博弈的智能小区代理商定价策略及电动汽车充电管理》基本复现 仿真平台:MATLAB+CPLEX gurobi平台 主要内容:代码主要做的是一个电动汽车充电管理和智能小区代理商动态定价的问题,将代理商和车主各自追求利益最大化建模为主从博弈,上层以代理商的充电电价作为优化变量,下层以电动汽车的充电策略作为优化变量,通过优化得出最优电价策略以及动态充电策略。 ,电动汽车; 主从博弈; 动态定价; 智能小区; 充放电优化; MATLAB; CPLEX; gurobi平台。,基于主从博弈的电动汽车充电管理与定价策略优化MATLAB代码实现

    (程序、GUI、思路)MATLAB打印纸缺陷检测GUI设计.zip

    基于Matlab语言实现的设计项目 2、适用人群:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业或毕业设计中的部分功能,作为“参考资料”使用。 3、解压说明:本资源需要电脑端使用WinRAR、7zip等解压工具进行解压,没有解压工具的自行百度下载即可。 4、免责声明:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。不一定能够满足所有人的需求,需要有一定的基础能够看懂代码,能够自行调试代码并解决报错,能够自行添加功能修改代码。由于作者大厂工作较忙,不提供答疑服务,如不存在资源缺失问题概不负责,谢谢理解。

    《基于 Transformer 的恶意软件检测器》(毕业设计,源码,教程)简单部署即可运行。功能完善、操作简单,适合毕设或课程设计.zip

    资源内项目源码是均来自个人的课程设计、毕业设计或者具体项目,代码都测试ok,都是运行成功后才上传资源,答辩评审绝对信服的,拿来就能用。放心下载使用!源码、说明、论文、数据集一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 4、如有侵权请私信博主,感谢支持

    Labiew噪音与振动检测模块源码揭秘:傅里叶变换与倍频程技术应用于实际项目,LabVIEW平台噪声与振动检测模块源码解析:基于傅里叶变换与倍频程原理的实用功能模块,已成功应用于实际项目,虚拟产品退换

    Labiew噪音与振动检测模块源码揭秘:傅里叶变换与倍频程技术应用于实际项目,LabVIEW平台噪声与振动检测模块源码解析:基于傅里叶变换与倍频程原理的实用功能模块,已成功应用于实际项目,虚拟产品退换政策严谨执行,Labiew噪音与振动检测模块源码,改功能模块已运用到实际项目,原理是利用傅里叶变和倍频程实现的,产品一旦发概不 。 需要的可以联系哟 ,Labiew源码; 噪音与振动检测模块; 傅里叶变换; 倍频程; 实际项目运用,Labiew傅里叶变换倍频程噪音振动检测模块源码

    基于Comsol多物理场仿真的光伏集热器异形体建模技术研究,探索comsol多物理场仿真技术:光伏集热器异形体建模应用,comsol多物理场仿真,光伏集热器,异形体建模 ,comsol多物理场仿真;

    基于Comsol多物理场仿真的光伏集热器异形体建模技术研究,探索comsol多物理场仿真技术:光伏集热器异形体建模应用,comsol多物理场仿真,光伏集热器,异形体建模 ,comsol多物理场仿真; 光伏集热器仿真; 异形体建模,Comsol多物理场仿真在光伏集热器及异形体建模中的应用

    器官3D分割-基于WinForm框架开发的医学影像系统源码+sln+演示视频(毕设基于c#和python开发).zip

    器官3D分割-基于WinForm框架开发的医学影像系统源码+sln+演示视频(毕设基于c#和python开发).zip 【项目简单介绍】 主要功能 肺炎诊断 器官 3D 分割 该系统具备肺炎诊断和器官 3D 分割的功能,并模仿了罗万科技的系统界面风格。 python和c#开发实现

    界面GUI设计MATLAB BP的水果识别.zip

    MATLAB可以用于开发水果识别系统。这种系统通常利用机器学习和图像处理技术,对输入的水果图像进行特征提取和分类识别。以下是开发水果识别系统的一般步骤: 1. 数据收集:收集包含各种水果类别的图像数据集。 2. 数据预处理:对图像进行预处理,包括裁剪、缩放、灰度化等操作。 3. 特征提取:从每个水果图像中提取特征,例如颜色直方图、纹理特征、形状特征等。 4. 数据标记:为每个图像标记水果类别,形成训练集和测试集。 5. 模型训练:使用机器学习算法(如支持向量机、卷积神经网络等)对训练集进行训练,建立水果识别模型。 6. 模型测试:使用测试集对模型进行测试和评估,调整模型超参数以提高准确率。 7. 系统集成:将训练好的模型集成到MATLAB应用程序中,实现水果识别功能。 8. 用户界面设计:设计用户友好的界面,以便用户上传水果图像并查看识别结果。 MATLAB提供了丰富的图像处理工具箱和机器学习工具箱,可以帮助开发者快速构建水果识别系统。通过结合这些工具箱,可以实现水果的快速、准确识别。

    COMSOL声子晶体仿真研究:一维至三维能带与带隙分析及色散曲线弹性波声波分析,声子晶体仿真:COMSOL代做能带图、带隙图及弹性波、声波分析与优化设计,COMSOL代做 声子晶体仿真,一维,二维,三

    COMSOL声子晶体仿真研究:一维至三维能带与带隙分析及色散曲线弹性波声波分析,声子晶体仿真:COMSOL代做能带图、带隙图及弹性波、声波分析与优化设计,COMSOL代做 声子晶体仿真,一维,二维,三维能带图,带隙图,色散曲线,弹性波,声波。 ,COMSOL代做;声子晶体仿真;一维/二维/三维能带图;带隙图;色散曲线;弹性波仿真;声波分析,COMSOL声子晶体仿真专家:一至三维声波模拟及能带图绘制

    Matlab Simulink仿真探究Flyback反激式开关电源性能表现与优化策略,Matlab Simulink仿真探究Flyback反激式开关电源的工作机制,Matlab Simulimk仿真

    Matlab Simulink仿真探究Flyback反激式开关电源性能表现与优化策略,Matlab Simulink仿真探究Flyback反激式开关电源的工作机制,Matlab Simulimk仿真,Flyback反激式开关电源仿真 ,Matlab; Simulink仿真; Flyback反激式; 开关电源仿真,Matlab Simulink在Flyback反激式开关电源仿真中的应用

    陪读租房系统(源码+数据库+论文+ppt)java开发springboot框架javaweb,可做计算机毕业设计或课程设计

    陪读租房系统(源码+数据库+论文+ppt)java开发springboot框架javaweb,可做计算机毕业设计或课程设计 【功能需求】 本系统有三个角色:管理员、租客和房主,要求具备以下功能: (a) 管理员;管理员使用本系统涉到的功能主要有:首页、个人中心、租客管理、房主管理、房源信息管理、房源类型管理、教育书籍管理、文章分类管理、租房信息管理、合同信息管理、在线咨询管理、咨阅回复管理、教育论坛、系统管理等功能。 (b) 租客;进入前台系统可以实现首页、房源信息、教育书籍、教育论坛、公告信息、后台管理等功能进行操作。 (C) 房主;进入系统可以实现首页、个人中心、房源信息管理、租房信息管理、合同信息管理、在线咨询管理、咨询回复管理等功能进行操作。 【环境需要】 1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.数据库:MySql 5.7/8.0等版本均可; 【购买须知】 本源码项目经过严格的调试,项目已确保无误,可直接用于课程实训或毕业设计提交。里面都有配套的运行环境软件,讲解视频,部署视频教程,一应俱全,可以自己按照教程导入运行。附有论文参考,使学习者能够快速掌握系统设计和实现的核心技术。

    vue3的一些语法以及知识点

    vue3的一些语法以及知识点

    libicu-doc-50.2-4.el7-7.x64-86.rpm.tar.gz

    1、文件内容:libicu-doc-50.2-4.el7_7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/libicu-doc-50.2-4.el7_7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、更多资源/技术支持:公众号禅静编程坊

    水果销售商城(源码+数据库+论文+ppt)java开发springboot框架javaweb,可做计算机毕业设计或课程设计

    水果销售商城(源码+数据库+论文+ppt)java开发springboot框架javaweb,可做计算机毕业设计或课程设计 【功能需求】 水果购物网站用户可以注册登录,在首页开通会员卡,查看水果,购买水果,查看水果信息,以及个人中心修改个人资料,在自己的后台查看自己的购买记录等。 水果购物网站管理员功能:个人中心管理,用户管理,会员管理,会员卡管理,开通会员记录管理,积分管理,水果管理,购买水果订单管理,积分兑换管理,积分兑换记录管理,加积分记录管理,减积分记录管理。 【环境需要】 1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.数据库:MySql 5.7/8.0等版本均可; 【购买须知】 本源码项目经过严格的调试,项目已确保无误,可直接用于课程实训或毕业设计提交。里面都有配套的运行环境软件,讲解视频,部署视频教程,一应俱全,可以自己按照教程导入运行。附有论文参考,使学习者能够快速掌握系统设计和实现的核心技术。

    基于Matlab的双输入深度学习模型构建指南:处理序列与图像数据的创新性应用,Matlab双输入深度学习模型搭建指南:如何处理两种输入数据并实现创新与优势,Matlab搭建双输入深度学习模型,双输入网

    基于Matlab的双输入深度学习模型构建指南:处理序列与图像数据的创新性应用,Matlab双输入深度学习模型搭建指南:如何处理两种输入数据并实现创新与优势,Matlab搭建双输入深度学习模型,双输入网络。 相比普通的单输入网络,双输入网络能处理两种输入数据,在科研上也更具有优势和创新性。 如何用Matlab搭建双输入网络也是困扰本人很长时间的一个问题,现已弄明白。 注意,需要Matlab 2022b及以上版本,以下版本估计是都不行。 本程序是两个输入全为一维序列的情况(第二个输入序列是第一个输入序列的特征值,或者变后的序列)。 也可改为两边输入都是图像,或者一边输入图像,一边输入图像的一维特征序列。 本程序工作如下: 1、加载数据,两种输入数据一一对应,第二个数据是第一个数据做FFT之后的序列,属于一个类别。 两种数据样本数相等,序列长度不相等。 2、搭建双输入网络,此网络一边是CNN-LSTM,一边是CNN。 3、训练。 4、测试,输出准确率。 注:程序可直接运行,包教会和调通。 可以有偿修改为两边输入都是图像,或一边输入图像一边输入序列的模型。 可有偿替数据,调通程序。 程序注释详

    十大管理的49个过程组强化记忆

    包含十大管理49个过程组的输入与输出和解释,还有EVA铮值管理的公式汇总和解释

Global site tag (gtag.js) - Google Analytics