RugbyXPi - first steps (and bugs?) ...
[1/2] from: petr:krenzelok:trz:cz at: 25-Jan-2002 8:30
Hi,
first steps with new Rugby .... strange result ...
->> start-profiling "pass"
== "Profiling started."
->> start: now/time/precise loop 100 [echo "la"] print now/time/precise -
start
0:01:23.59
(I am not sure if the slowdown was because of profiler or because of ZoneAlarm
firewall)
->> print profile-data "pass"
** Math Error: Attempt to divide by zero
** Near: to-integer (to-decimal val/1) / (to-decimal time) *
->> reset-profiler "pass"
== 8:14:46.78
Now the question - does 'reset-profiler only resets the profiler, or does it
stop it?
a) if it stops profiling - rename the function, please
b) if it only resets profiler data, then add function to stop profiling ...
New try to use profiler:
->> start-profiling "pass"
** Script Error: Duplicate function value: profiler-data
** Near: func compose [(do mold header) /profiler-data profiler-ticket return
exit]
compose/deep [
profiler-data: (copy/deep [[]])
either empty? profiler-data
[
repend profiler-data
[
return: func [[throw] value [any-type!]]
[
profiler-deregister profiler-ticket
system/words/return get/any 'value
]
exit: func [[throw]] [return]
]
]
[
set [return exit] profiler-data
]
profiler-ticket: profiler-register (name)
set/any 'val do (reduce [body])
profiler-deregister profiler-ticket
get/any 'val
]
What I still can't get used to:
- naming confusion - start-PROFILING, reset-PROFILER, PROFILE-data ... what
about profiler/start, profiler/reset, profiler/stop, profiler/get-data = only
ONE function and its refinements to remember .... believe me - it is difficult
for me to remember all that function name variants and required order of words
in function names ....
- I forget to send password parameter to above functions each time :-) Maybe
it is just because it is rather new functionality ... let's see how it will
evolve ...
Let's get Rugby being smart for its users :-) Well, on the other hand, if we
will use refined functions, what equivalent will Ruby users use? ;-)
Cheers,
-pekr-
[2/2] from: m::koopmans2::chello::nl at: 25-Jan-2002 9:57
Petr,
Thanks for your comments. That's why I am releasing betas. Expect many to
come! Think it is your firewall because on my laptop it takes less than two
seconds.
The profiler is started once and currently can't be stopperd. Restarting it
causes the error you just described. I am looking into that.
Reset-profiler resets the timer. profile-data should give good results, I'll
look into that as well.
Compression will be added in a final release. Rugby uses a consistent
indentation, just a different one than you like. Sorry for that, but I like
it, and as I spent much time in the code.....
Your naming suggestions are already scheduled, so they will appear in XPi
for sure.
I am currently working on a module system and on a redirect function for
server chaining (non-blocking!).
BTW: most people don't realize it but Rugby implements non-blocking IO with
a state machine which is (very close to) async IO....
--Maarten