World: r3wp
[Profiling] Rebol code optimisation and algorithm comparisons.
older newer | first last |
Terry 27-May-2010 [328] | My timings were for a script, where intersecting was one part. Whether intersecting block or hash made no noticeable difference. |
Ladislav 27-May-2010 [329] | Well, since your timings did not detect, that hash intersects are *much* faster than block intersects, this is a proof, that your timings do have very little in common with the speed of intersect |
Terry 27-May-2010 [330] | one odd thing i find with timing in general is why do i get random values each time i run a script? shouldn't it always be the same? |
PeterWood 27-May-2010 [331] | I would be very suspicious if the timings where the same. All machines these days are running multiple processes so your script's access to the processor will differ each time you run it. Rebol itslef may well be inconsistent as the garbage collector will run at differnet points in you tests. |
Oldes 27-May-2010 [332] | What do you mean by random values? I can see some differencies, but not so random. The function I use for timing is: tm: func [count [integer!] code [block!] /local t][t: now/time/precise loop count code probe now/time/precise - t] |
Ladislav 27-May-2010 [333] | As opposed to that, I propose a more precise http://www.fm.tul.cz/~ladislav/rebol/timblk.r |
Steeve 27-May-2010 [334] | Vista --> 0.000990825688073395 |
Ladislav 27-May-2010 [335] | thanks, Steeve, that looks like 1 millisecond, taking into account the given 5% precision |
Ladislav 31-May-2010 [336] | Hi all, I adjusted the http://www.fm.tul.cz/~ladislav/rebol/timblk.r file to reflect Steeve's measurement, but would like to obtain more results (results for other operating systems). If you have the results that are not already in the file, please, let me know. |
Oldes 31-May-2010 [337x2] | R2, XP ---> 1.54857142857143E-2 |
sorry, it's already in the file., And it's XP SP3 | |
Paul 31-May-2010 [339] | 9.8876404494382E-4 Vista |
Gregg 31-May-2010 [340] | XP x64 == 1.54678899082569E-2 |
Ladislav 31-May-2010 [341x2] | thanks, I assume, Gregg, that your value is either for XP x64 SP2 or SP3? |
hmm, Paul's value is quite strange, taking into account, that Steeve measured it to be 1 ms | |
Paul 31-May-2010 [343] | mine is on 32 bit Vista running AMD. |
Ladislav 31-May-2010 [344] | aha, OK, the difference is still just 1.12%, i.e. it is in the tolerance |
Gregg 31-May-2010 [345] | Sorry, yes, SP2. |
Steeve 31-May-2010 [346x2] | Btw, got the same results with R2 and R3 |
This test shows well why some graphical demos work bad on some systems even if the computers are faster than mine (Vista with a tiny celeron). | |
Ladislav 31-May-2010 [348x2] | hmm, I just checked a Vista Business 64 bit (not updated for quite some time), and it used 15.5 milliseconds too... |
The same result with R2 and R3 - of course, this value is a property of the operating system | |
Maxim 31-May-2010 [350x2] | it could have been that they use different timer libs. |
or whatever lib the core uses to calculate time | |
Ladislav 31-May-2010 [352x2] | well, this is not about "time calculation", it is about frequency of time update |
but, certainly, it is possible to update the time every time the operating system is asked to provide the time. That way, the time can be updated as frequently, as the program is able to ask. I guess, that in Linux it works that way, any results? | |
Maxim 31-May-2010 [354x2] | Although I can only guess, I think the issue lies in that the actual os calls being used do not provide greater precision. In R3 there are other means to get the time which do provide much greater precision, so its strange that they do not also apply to now/precise. |
wrt "get the time"... I meant to say: get timing information | |
Ladislav 31-May-2010 [356] | ...its strange that they do not also apply... - nothing strange, it is a different kind of counter, not the one used to get the system time (that might mean, that it actually is less precise, e.g.) |
Maxim 31-May-2010 [357x2] | What I think too... but if R3 can get precise timing info, it could arguably add this precise elapsed period since last *time* check and add it to the result when now/precise is called in a script. just an idea... thinking out loud. |
even in R2, when you look at an event! object, the timing counter within is much more precise than now/precise... which is why I can use mouse move events to check time elapsed much more precisely than the mediocre 'time event generating, OS timer which /view is using. | |
Ladislav 31-May-2010 [359] | precise timing - that is exactly the opposite meaning than what I am using. Example: clocks usually display time in seconds, using second as the smallest unit. That does not mean, clocks are imprecise, they may actually be more precise, than a counter counting every microsecond, e.g., but with a 0.1 % error, meaning, that in one day, such a counter may be e.g. one and a half minute slow in one day |
Maxim 31-May-2010 [360] | well there are different precisions ;-) resolution and measure. what we are measuring here is the resolution. no? |
Ladislav 31-May-2010 [361] | yes, exactly |
Andreas 31-May-2010 [362] | >> do http://www.fm.tul.cz/~ladislav/rebol/timblk.r Warning: clock tick too short, the result is the loop body execution time! == 5.53774319066148E-5 R2 2.7.7 on Linux, 64b (even though I guess the warning means the result is useless :) |
Maxim 31-May-2010 [363] | hence the use of word "timing" ;-P adding timing resolution within the "passage of time" resolution would be arguably sufficient for me even if it meant we are ~0.1 ms off, as long as we get a constant increment of milliseconds (or better) to use. right now the time resolution is sooo poor (on windows) its often frustrating. |
Ladislav 31-May-2010 [364x3] | thanks, Andreas, it does not mean, that the result is useless, actually, it just means, that the resolution is finer than Rebol is able to measure |
nevertheless, it means, that you may well use this value as the clock granularity for the profiling purposes, since the actual granularity is even better | |
so, we can say, that the clock resolution in Linux is better than 55 microseconds | |
PeterWood 31-May-2010 [367] | Script: "Time-block" (31-May-2010/11:01:46+2:00) Warning: clock tick too short, the result is the loop body execution time! == 2.09338521400778E-6 Rebol 2.7.5 on Mac OS X 10.64 bit |
Izkata 31-May-2010 [368] | Script: "Time-block" (31-May-2010/11:01:46+2:00) Warning: clock tick too short, the result is the loop body execution time! == 3.37364341085271E-5 Rebol 2.7.6 on Ubuntu Hardy 64-bit |
Ladislav 1-Jun-2010 [369x2] | Peter - hmm, better resolution, than 2 microseconds, that is quite fast machine |
but, generally, it looks, that Windows may well be the only operating system currently, that still has a detectable resolution time of operating system clock | |
Gabriele 1-Jun-2010 [371x2] | REBOL/Core 2.7.6.4.2 (14-Mar-2008) >> do http://www.fm.tul.cz/~ladislav/rebol/timblk.r connecting to: www.fm.tul.cz Script: "Time-block" (31-May-2010/11:01:46+2:00) Warning: clock tick too short, the result is the loop body execution time! == 2.48837209302326E-5 |
this is Linux Mint 7 64bit | |
PeterWood 1-Jun-2010 [373] | Ladislav - It's a 2.5 year old MacBookPro with a 2.4GHz Core 2 Duo - I think there are much faster processors around these days. |
Davide 1-Jun-2010 [374] | OpenBSD.i386 REBOL/Core 2.7.7.9.4 (5-Apr-2010) >> do http://www.fm.tul.cz/~ladislav/rebol/timblk.r connecting to: www.fm.tul.cz Script: "Time-block" (1-Jun-2010/13:40:09+2:00) Warning: clock tick too short, the result is the loop body execution time! == 2.94573643410853E-6 |
Ladislav 2-Jun-2010 [375] | Well, Peter, that is possible, but it looks, that your processor is about ten times faster than the one Gabriele or Andreas use |
Rebolek 2-Jun-2010 [376] | Isn't it OS-dependent? BSD&OSX value seems to be about 2E-6, while Linux is around 2E-5 . |
PeterWood 2-Jun-2010 [377] | This entry at Wikipedia seems to suggest that is it OS dependent - http://en.wikipedia.org/wiki/System_time#Operating_systems |
older newer | first last |