Re: [Factor-talk] benchmark is rigged?
Hello! I ran the same test suite a few times adding and removing the /usepmtimer option and rebooting the system. The results were consistent: when the option switch is there, `benchmark` works correctly, otherwise it doesn't. When it didn't work it could measure an 80-second quotation and say that it ran in under one second. I was tempted to switch to the `now now swap time-` approach, but decided against it, seeing that the Boot.ini option has reliably fixed the `benchmark`. The GetTickCount is what I would normally use in Delphi, especially since I don't need a sub-second precision anyway for my use case, but in Factor I decided to go with the standard Factor library, and therefore the `benchmark` word. I don't think that's something to be fixed in Factor. That's a Windows (or maybe even BIOS or a CPU) problem, so there has to be the kind of fix that I implemented. It's on par with having the correct driver for the system hardware - you can't expect application software to compensate for that. And yes, let's hope newer Windows versions and PCs are not going to have problems like that. 30.07.2016, 02:31, "Björn Lindqvist" : > That is very interesting! I've looked at how Python does benchmarking > and it does not use QPC: > > On Windows, QueryPerformanceCounter() is not used even though it has a > better resolution than GetTickCount() . It is not reliable and has too > many issues. > > https://www.python.org/dev/peps/pep-0418/ > > So we could switch to use GetTickCount() instead but the drawback is > that that function has abysmal resolution. Then again, XP is a very > old operating system.. ---=--- Александр -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Font
I think adding the images to the image would be neat. The icon for Factor is already embedded in the image like you suggest. You can see the code for that in basis/ui/backend/gtk/gtk.factor. Something like that could be generalized to work for other images too. Then if you are making a game or something, all your assets would be neatly packed into a single .exe file. 2016-07-25 18:34 GMT+02:00 Alexander Ilin : > Hello! > > 25.07.2016, 16:47, "John Benediktsson" : > > You can reset the memoized so then next time it gets called it will memoize > again: > > IN: scratchpad \ windows-fonts reset-memoized > > > > Hold on a second! Looking at the `startup-hooks`, I see one hook named > "windows.fonts", and it does this: > `[ \ (cache-font) reset-memoized ]` > > Shouldn't we add `\ windows-fonts reset-memoized` to the same existing > hook? > > > You could probably put that in a .factor-rc if you need it run on startup. > > > > No, I probably found a bug! : ) Let's fix the hook instead! > https://github.com/factor/factor/pull/1678 > > > Why do you need those icon images cached in the Factor image? > > > I think it's a bit awkward to have everything in the image, except for the > images. > Get it? Images? > Never mind. > > ---=--- > Александр > > > -- > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning > reports.http://sdm.link/zohodev2dev > ___ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk > -- mvh/best regards Björn Lindqvist -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] benchmark is rigged?
That is very interesting! I've looked at how Python does benchmarking and it does not use QPC: On Windows, QueryPerformanceCounter() is not used even though it has a better resolution than GetTickCount() . It is not reliable and has too many issues. https://www.python.org/dev/peps/pep-0418/ So we could switch to use GetTickCount() instead but the drawback is that that function has abysmal resolution. Then again, XP is a very old operating system.. 2016-07-24 23:43 GMT+02:00 Alexander Ilin : > Hello! > > It looks like adding the /usepmtimer switch to the boot.ini has fixed the > problem for that PC. At least the same test cases no longer reproduce the > error after a reboot. > > Source of inspiration: http://www.virtualdub.org/blog/pivot/entry.php?id=106 > > 24.07.2016, 21:59, "Alexander Ilin" : >> Hello! >> >> I'm having a weird problem with the benchmark word on my WinXP SP3 32-bit >> machine, running the latest Factor from Github master. >> >> The benchmark word reports times under or about 1 second (1,000,000,000) >> for some piece of code, but the actual run time of the quotation is always >> about 5-6 seconds. >> >> For example, here's a sketch of a test session, without restarting a >> Factor instance, done in the following order. >> >> This code would show running time < 1 sec: >> >> [ do-smth ] benchmark >> >> Then this code would show the correct wall time for both the time word and >> the benchmark word: >> >> [ [ do-smth ] time ] benchmark >> >> This would show the correct timing for both words as well: >> >> [ [ do-smth ] benchmark ] time >> >> Finally, returning to this code again measures incorrectly (< 1 sec): >> >> [ do-smth ] benchmark >> >> Has anyone experienced anything like this before? >> >> Replacing [ do-smth ] with [ now do-smth now ] shows the correct time in >> all cases, and by calculating difference I can see that benchmark calculates >> incorrectly. But I can't figure out the reason. >> >> On the other hand, replacing [ do-smth ] with [ nano-count do-smth >> nano-count ] I see that benchmark is right. So, the problem is that for some >> reason nano-count returns lower time difference for the code I run, >> depending on the way I run it - with or without the "time" word. > > ---=--- > Александр > > -- > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity planning > reports.http://sdm.link/zohodev2dev > ___ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk -- mvh/best regards Björn Lindqvist -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Fractional Part Function
Hello, John! I like it, thank you! 29.07.2016, 17:12, "John Benediktsson" :You could use ``1 mod``: IN: scratchpad 123.45038945034895 1 mod . 0.4503894503489505 IN: scratchpad -123.45038945034895 1 mod . -0.4503894503489505 On Fri, Jul 29, 2016 at 6:41 AM, Alexander Ilinwrote:Hello! I can't find the function that would return the fractional part of a float in our standard library. I need something to this effect: http://www.freepascal.org/docs-html/rtl/system/frac.html A little help, please? ---=--- Александр -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk,--,___Factor-talk mailing listFactor-talk@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/factor-talk ---=---Александр -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Fractional Part Function
Also, the ``math.floating-point`` vocabulary provides a way to turn doubles into ratios: IN: scratchpad 3.14159 double>ratio . 3+159416167809847/1125899906842624 On Fri, Jul 29, 2016 at 7:11 AM, John Benediktsson wrote: > You could use ``1 mod``: > > IN: scratchpad 123.45038945034895 1 mod . > 0.4503894503489505 > > IN: scratchpad -123.45038945034895 1 mod . > -0.4503894503489505 > > > > On Fri, Jul 29, 2016 at 6:41 AM, Alexander Ilin wrote: > >> Hello! >> >> I can't find the function that would return the fractional part of a >> float in our standard library. >> I need something to this effect: >> http://www.freepascal.org/docs-html/rtl/system/frac.html >> >> A little help, please? >> >> ---=--- >> Александр >> >> >> -- >> ___ >> Factor-talk mailing list >> Factor-talk@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/factor-talk >> > > -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Fractional Part Function
You could use ``1 mod``: IN: scratchpad 123.45038945034895 1 mod . 0.4503894503489505 IN: scratchpad -123.45038945034895 1 mod . -0.4503894503489505 On Fri, Jul 29, 2016 at 6:41 AM, Alexander Ilin wrote: > Hello! > > I can't find the function that would return the fractional part of a > float in our standard library. > I need something to this effect: > http://www.freepascal.org/docs-html/rtl/system/frac.html > > A little help, please? > > ---=--- > Александр > > > -- > ___ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk > -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Fractional Part Function
Hello! I can't find the function that would return the fractional part of a float in our standard library. I need something to this effect: http://www.freepascal.org/docs-html/rtl/system/frac.html A little help, please? ---=--- Александр -- ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk