Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,17 @@ run-d: d
analyze-d:
@echo "Max Pause: "
@cat d.log

eiffel: main.e
/opt/estudio/studio/spec/linux-x86-64/bin/ec -finalize main.e -library time
chmod +x main

clean::
rm -rf main EIFGENs

run-eiffel: eiffel
./main > eiffel.log
cat eiffel.log

analyze-eiffel:
@cat eiffel.log
70 changes: 70 additions & 0 deletions main.e
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
note
description: "GC_performance application root class"
date: "$Date$"
revision: "$Revision$"

class
MAIN

inherit
ARGUMENTS

create
make

feature createMessage(n: INTEGER): ARRAY[INTEGER_8]
local
msg: ARRAY[INTEGER_8]
do
create msg.make_filled(n.as_integer_8, 0, msgSize-1)
Result:= msg
end

feature pushMessage(map: HASH_TABLE[ARRAY[INTEGER_8],INTEGER]; id: INTEGER)
local
lowId : INTEGER
do
lowId := id - windowSize
map.put (createMessage(id), id)
if lowId>=0 then
map.remove (lowId)
end
end

feature {NONE} -- Initialization
windowSize : INTEGER = 200_000
msgCount : INTEGER = 1_000_000
msgSize : INTEGER = 1024

make
-- Run application.
local

map : HASH_TABLE[ARRAY[INTEGER_8],INTEGER]
i : INTEGER
currentTime, lastTime: TIME
iterPause, maxPause: TIME_DURATION
do
create map.make(0)

create lastTime.make_now
create maxPause.make_by_fine_seconds (0.0)

from i:=0
until i=msgCount
loop
pushMessage(map,i)
create currentTime.make_now
iterPause:= currentTime.relative_duration (lastTime)
if iterPause>maxPause then
maxPause:= iterPause
end
lastTime:= currentTime
i:= i + 1
end
print("Max pause: ")
print (maxPause.fine_second*1000.0)
print (" ms %N")
end

end