mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-03 08:41:02 +08:00
9ab60dabcc
Simple scripts to generate performance benchmarks for label, macro and token lookups. The label and macro lookups are simple numerical sequences; it may be desirable to add some more sophisticated algorithms for producing tokens in case we want to compare different hash functions against each other.
19 lines
313 B
Perl
Executable File
19 lines
313 B
Perl
Executable File
#!/usr/bin/perl
|
|
#
|
|
# Generate a test case for label lookup performance
|
|
#
|
|
|
|
($len) = @ARGV;
|
|
$len = 100000 unless ($len);
|
|
|
|
print "\tbits 32\n";
|
|
print "\tsection .data\n";
|
|
print "\n";
|
|
|
|
for ($i = 0; $i < $len; $i++) {
|
|
print "l$i:\n";
|
|
for ($j = 0; $j < 8; $j++) {
|
|
print "\tdd l", int(rand($i+1)), "\n";
|
|
}
|
|
}
|